-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add content at end of control #383
Comments
hi any reply on this I am trying to figure out how this plugin works but have hard time fixing it.. $templates = [ I am using this but with no luck all that happen is the extra echo $this->Form->control('name', ['label' => 'Name', 'extra' => 'how are you doing?' , 'templates' => $templates]); expected result: how are you doing?
actual Can tell me what I am doing wrong here? greets, |
Also it would appear that the error messages are no longer shown on text inputs? Is this broken ? |
You cannot add custom templates like that, the underlying string template functionality provided by CakePHP doesn't support that. What you can do however is adding template variables: $this->Form->setTemplates([
'inputContainer' =>
'<div{{containerAttrs}} ' .
'class="{{containerClass}}form-group {{type}}{{required}}">{{content}}{{help}}{{extra}}</div>',
'inputContainerError' =>
'<div{{containerAttrs}} ' .
'class="{{containerClass}}form-group {{formGroupPosition}}{{type}}{{required}} is-invalid">' .
'{{content}}{{error}}{{help}}{{extra}}</div>',
]);
// ...
echo $this->Form->control('name', [
'label' => 'Name',
'templateVars' => [
'extra' => 'how are you doing?'
],
]); |
thanks, will take a look at that |
Hi,
I want to add content at the end of a form control. eg another hidden input. I can use the help option but then it will be inside the small container. Is there another option I am overlooking?
The text was updated successfully, but these errors were encountered: