# Cake PHP Form Helper

**URL:** <https://discourse.cakephp.org/t/cake-php-form-helper/1112>\
**Category:** Need Help\
**Created:** [September 6, 2016, 2:01pm UTC](https://discourse.cakephp.org/t/cake-php-form-helper/1112 "2016-09-06T14:01:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexk2oo](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@alexk2oo](https://discourse.cakephp.org/u/alexk2oo)\
**Post date:** [September 6, 2016, 2:01pm UTC](https://discourse.cakephp.org/t/cake-php-form-helper/1112/1 "2016-09-06T14:01:55Z")

</div>

Hi,

Can someone hep me and tell me how he form helper should look in order to generate the following HTML:

```
<div class="form-group">
   <label for="input-Default" class="col-sm-2 control-label">Default</label>
       <div class="col-sm-10">
             <input type="text" class="form-control" id="input-Default">
       </div>
  </div>

```

Thanks

---

<div class="post-metadata">

**Author:** ![ali](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/ali/32/123_2.png) [@ali](https://discourse.cakephp.org/u/ali)\
**Post date:** [September 6, 2016, 2:27pm UTC](https://discourse.cakephp.org/t/cake-php-form-helper/1112/2 "2016-09-06T14:27:52Z")

</div>

The form helper isn’t really flexible enough to allow for any kind of structure, but you could create your own form templates as described here:

[http://book.cakephp.org/3.0/en/views/helpers/form.html#customizing-the-templates-formhelper-uses](http://book.cakephp.org/3.0/en/views/helpers/form.html#customizing-the-templates-formhelper-uses)

However, this is only sensible if you really plan on using these new structures all the time in your project. If it’s a one time thing, it makes more sense to just use HTML and fill it with the appropriate variables or create a helper.

---

<div class="post-metadata">

**Author:** ![raul338](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/raul338/32/69_2.png) [@raul338](https://discourse.cakephp.org/u/raul338)\
**Post date:** [September 7, 2016, 1:31am UTC](https://discourse.cakephp.org/t/cake-php-form-helper/1112/3 "2016-09-07T01:31:30Z")

</div>

Looks like you can use [Holt59’s CakePHP 3.x Helpers for Bootstrap](https://github.com/Holt59/cakephp3-bootstrap-helpers)

Also in the thrid parameter, any non-special key (like values for a select) remain as an attribute for the element

---

<div class="post-metadata">

**Author:** ![rahadur](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rahadur/32/595_2.png) [@rahadur](https://discourse.cakephp.org/u/rahadur)\
**Post date:** [October 26, 2017, 5:10am UTC](https://discourse.cakephp.org/t/cake-php-form-helper/1112/4 "2017-10-26T05:10:44Z")

</div>

Thanks @ali 😀 100% helpful for me
