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(); ?> Quote
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")); LukesUbuntu and Michael 2 Quote
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 Quote
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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.