form helpers - Prevent CakePHP to create div with input field -
every time create input field using
$this->form->input('name');
it creates div element
<div class="input name"> <input type="text"> </div>
is there way prevent creation of div block around input field. also, there way add custom class div
created? like
<div class="input name mystyle"> <input> </div>
i'm using cakephp 3.2
you need override templates. can creating new config file:
config/app_form.php
return [ 'inputcontainer' => '{{content}}' ];
then load in view:
src/view/appview.php
class appview extends view { public function initialize() { parent::initialize(); $this->loadhelper('form', ['templates' => 'app_form']); } }
http://book.cakephp.org/3.0/en/views/helpers/form.html#customizing-the-templates-formhelper-uses
Comments
Post a Comment