Jump to content

Form Class?


Michael

Recommended Posts

 

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"));
Link to comment
Share on other sites

 

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...