Saturday, March 28, 2015

3.0 FormHelper pass arbitrary data to stringTemplates?

It would be nice to pass-through arbitrary values to the stringTemplates in form helper.
```
$this->Form->templates(['inputContainer' => '<div class="{{outclass}}">{{content}}</div>']);
```

I think this could be done through the options passed to the helper method.
```php
$this->Form->input('field', ['templateVars' => ['outclass' => 'col-1-2']]);
```
I can work on the PR if this seems like a good approach. I am mostly interested in this for being able to set the class of the inputContainer div, but it does seem like there could be other reasons this would be useful.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: