Code Monkey home page Code Monkey logo

Comments (9)

Anahkiasen avatar Anahkiasen commented on May 30, 2024

Does it work if you set the label to null ?

from former.

cviebrock avatar cviebrock commented on May 30, 2024

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.

Anahkiasen avatar Anahkiasen commented on May 30, 2024

Oh ok I see what you mean, I'll see about that.

from former.

Anahkiasen avatar Anahkiasen commented on May 30, 2024

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.

cviebrock avatar cviebrock commented on May 30, 2024

Sweet!

from former.

cviebrock avatar cviebrock commented on May 30, 2024

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="&lt;a href=&quot;###&quot;&gt;Click here.&lt;/a&gt;" type="group" name="Forgot your password ?" id="Forgot your password ?">
  </div>
</div>

from former.

Anahkiasen avatar Anahkiasen commented on May 30, 2024

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.

cviebrock avatar cviebrock commented on May 30, 2024

L3, and I did a artisan bundle:upgrade former

from former.

Anahkiasen avatar Anahkiasen commented on May 30, 2024

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 of Former\Former

from former.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.