Jump to content

Recommended Posts

Posted

 

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"));
Posted

 

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 :D

Posted

Thanks Tyson mate, I tried just the array without the null and it did the actions so need null then array :D

 

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.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...