Michael Posted October 21, 2015 Report Posted October 21, 2015 Is there a way guys to set a class for the form: <?php $this->Form->create(); ?>
Tyson Posted October 21, 2015 Report Posted October 21, 2015 Is there a way guys to set a class for the form: <?php $this->Form->create(); ?> First parameter to Form::create is the URI to POST to, default null for current page. Second parameter is an array of attributes--this is where you can set your class. e.g. $this->Form->create(null, array('class' => "class1 class2 class3")); Michael and LukesUbuntu 2
Michael Posted October 21, 2015 Author Report Posted October 21, 2015 First parameter to Form::create is the URI to POST to, default null for current page. Second parameter is an array of attributes--this is where you can set your class. e.g. $this->Form->create(null, array('class' => "class1 class2 class3")); Thanks Tyson mate, I tried just the array without the null and it did the actions so need null then array
Tyson Posted October 21, 2015 Report Posted October 21, 2015 Thanks Tyson mate, I tried just the array without the null and it did the actions so need null then array Yes, that is how passing parameters works. If you want to specify a third parameter, for instance, you must also explicitly pass the first and second parameters, regardless of whether they are optional. Michael 1
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now