Lansoweb / LosUi

ZF2 Module for UI using Bootstrap3, jQuery, Chosen, etc
http://en.leandrosilva.info/zf2-modules
BSD 3-Clause "New" or "Revised" License
9 stars 5 forks source link

formInput Helper #10

Closed N3XT0R closed 9 years ago

N3XT0R commented 9 years ago

Hello,

i have a feature-request for your module. Sometimes it is needed to have Input-Fields without a label. At Example: Search-Fields.

Normally zf2 have a view helper called "formInput" for it. It would be great when you would implement it too.

Lansoweb commented 9 years ago

Hi @N3XT0R, sorry for the delay. Actually, the current losFormRow handles inputs without labels, just do not define it:

   /**
     * @ORM\Column(type="string")
     * @Form\Filter({"name":"StringTrim"})
     * @Form\Validator({"name":"StringLength", "options":{"min":3, "max":250}})
     * @Form\Attributes({"type":"text","placeholder":"Search"})
     * @Form\Options({"label":"Search"})
     */
    protected $search;

Will generate the label, so just remove the label:

   /**
     * @ORM\Column(type="string")
     * @Form\Filter({"name":"StringTrim"})
     * @Form\Validator({"name":"StringLength", "options":{"min":3, "max":250}})
     * @Form\Attributes({"type":"text","placeholder":"Search"})
     */
    protected $search;