Comments (9)
Does it work if you set the label to null
?
from former.
I can get a non-labelled row easily ... but how do I tell Former I just want text on the right side, not an input field of any kind?
- Colin
On 2013-01-25, at 12:44 PM, Maxime Fabre wrote:
Does it work if you set the label to null ?
—
Reply to this email directly or view it on GitHub.
from former.
Oh ok I see what you mean, I'll see about that.
from former.
Done. You can now do this to put group-wrapped custom content in your forms :
Former::group()->contents('Forgot your password? <a href="###">Click here.</a>')
Former::group('Forgot your password ?')->contents('<a href="###">Click here.</a>')
The latter will put the "Forgot your password" part as label, as if it was a field label.
If you have more contents or else, the old way still works :
{{ Former::group() }}
<div class='controls'>Your content</div>
{{ Former::closeGroup() }}
from former.
Sweet!
from former.
Actually, I'm not sure if this works. I tried
Former::group()->contents('Forgot your password? <a href="###">Click here.</a>')
And get the following output:
Unhandled Exception
Message:
Undefined variable: _value
Location:
/Users/cmv/Sites/sirius/bundles/former/src/Former/fields/input.php on line 27
Stack Trace:
#0 /Users/cmv/Sites/sirius/laravel/laravel.php(42): Laravel\Error::native(8, 'Undefined varia...', '/Users/cmv/Site...', 27)
#1 /Users/cmv/Sites/sirius/bundles/former/src/Former/fields/input.php(27): Laravel\{closure}(8, 'Undefined varia...', '/Users/cmv/Site...', 27, Array)
#2 /Users/cmv/Sites/sirius/bundles/former/src/Former/former.php(122): Former\Fields\Input->__construct('group', NULL, NULL, NULL, NULL, NULL, NULL)
#3 /Users/cmv/Sites/sirius/laravel/view.php(386) : eval()'d code(35): Former\Former::__callStatic('group', Array)
#4 /Users/cmv/Sites/sirius/laravel/view.php(386) : eval()'d code(35): Former\Former::group()
#5 /Users/cmv/Sites/sirius/laravel/view.php(386): eval()
#6 /Users/cmv/Sites/sirius/laravel/blade.php(71): Laravel\View->get()
#7 [internal function]: Laravel\Blade::Laravel\{closure}(Object(Laravel\View))
#8 /Users/cmv/Sites/sirius/laravel/event.php(199): call_user_func_array(Object(Closure), Array)
#9 /Users/cmv/Sites/sirius/laravel/event.php(138): Laravel\Event::fire('laravel.view.en...', Array, true)
#10 /Users/cmv/Sites/sirius/laravel/view.php(348): Laravel\Event::until('laravel.view.en...', Array)
#11 /Users/cmv/Sites/sirius/laravel/view.php(590): Laravel\View->render()
#12 /Users/cmv/Sites/sirius/laravel/response.php(268): Laravel\View->__toString()
#13 /Users/cmv/Sites/sirius/laravel/laravel.php(180): Laravel\Response->render()
#14 /Users/cmv/Sites/sirius/public/index.php(34): require('/Users/cmv/Site...')
#15 {main}
Trying the second option:
Former::group('Forgot your password?')->contents('<a href="###">Click here.</a>')
generates the following HTML:
<div class="control-group">
<label for="Forgot your password ?" class="control-label">Forgot your password ?</label>
<div class="controls">
<input contents="<a href="###">Click here.</a>" type="group" name="Forgot your password ?" id="Forgot your password ?">
</div>
</div>
from former.
Hm, maybe it takes some time for the push to get to Packagist. What are you using Former with (L3/L4/etc) and what branch ? Cause the master
branch doesn't really get updated anymore, the agnostic
branch now handles Laravel 3, Laravel 4 and stand alone, but since I still haven't found a way to hardcode the Composer dependencies in the repo to allow installation via Artisan...
from former.
L3, and I did a artisan bundle:upgrade former
from former.
Yeah so no, you don't have the latest version, you still have Former 2 — the update I pushed was to Former 3. If you really want Former 3 for now you have to do this :
- Clone the agnostic branch in
bundles/former
- Go into the folder
- Do
composer update
- Change your alias to point to
Former\Facades\LaravelThree
instead ofFormer\Former
from former.
Related Issues (20)
- Add method to create new field from string HOT 7
- Allow field->required() to receive a boolean HOT 1
- Allow field->inline() to receive a boolean HOT 2
- Add a Choice field type HOT 4
- Laravel 5.7 support HOT 1
- Support Bootstrap4 HOT 1
- Former Twitter Bootstrap 4 Not working HOT 2
- Custom Rule classes not working HOT 1
- Bootstrap 4 Framework uses wrong classes for input group & no classes for checkbox HOT 8
- Can Former be used outside/without Laravel? HOT 2
- Multiple attributes treated differently from single attribute in queryToArray
- Form echo like a text Laravel 5.7
- Encode checkbox value to prevent XSS attack HOT 1
- Bootstrap 4 throws error without open and close tag HOT 2
- How to style checkboxes HOT 6
- Laravel 8 support. HOT 1
- How to use vuejs directives with former HOT 2
- Former::date help HOT 1
- _method HOT 2
- How to use as a standalone PHP HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from former.