Comments (4)
hi any reply on this I am trying to figure out how this plugin works but have hard time fixing it..
$templates = [
'inputGroupContainer' =>'<div{{attrs}}>{{prepend}}{{content}}{{append}}{{extra}}',
'extra' => '{{content}}',
];
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:
actual
Can tell me what I am doing wrong here?
greets,
Thomas
from bootstrap-ui.
Also it would appear that the error messages are no longer shown on text inputs? Is this broken ?
from bootstrap-ui.
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?'
],
]);
- https://book.cakephp.org/4/en/views/helpers/form.html#customizing-the-templates-formhelper-uses
- https://book.cakephp.org/4/en/views/helpers/form.html#adding-additional-template-variables-to-templates
from bootstrap-ui.
thanks, will take a look at that
from bootstrap-ui.
Related Issues (20)
- How To - Bypass default template from bootstrap-ui
- Badge cannot remove 'bg-secondary' class after adding other bootstrap classes HOT 1
- $this->Form->select() missing "form-select" class
- Notice of undefined index on using prepend for inputs
- Add helpers for Cards/Modal/etc HOT 2
- Needs buttonhelper HOT 5
- Bootstrap-ui form-helper is adding form-group class to controls HOT 2
- Error in dashboard.php
- Support custom confirmJs on postLink (with access to formName of parent::postLink) HOT 9
- selectbox not using bootstratp-ui HOT 1
- overwrite bake templates HOT 7
- change bake template
- tooltips
- Cake 5 composer requires branch that doesn't exist HOT 2
- 5.x: undefined index notices HOT 4
- Option ['role' => 'form'] is not necessary for Form::create()
- overwrite flash template
- Multi checkbox in cake5 / BS5 HOT 2
- Duplicate script name "stan-setup" in composer .json HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-ui.