On Dec 5, 2010, at 17:52, Dave Maharaj wrote:

> <?php echo $this->Form->create('User', array('id' => 'Registration', 
> 'controller' => 'users', 'action' => registration' ));?>
>  
> <form accept-charset="utf-8" action="/register" method="post" 
> controller="users" id="Registration">
>  
> …form….
>  
> <div style="display: none;"><input type="hidden" value="POST" 
> name="_method"></div>  
>  
> Where is controller="users" in the html code coming from?

I think you asked for it, by passing it in the array in the second parameter to 
$this->Form->create. It appears, based on reading the code of 
cake/libs/view/helpers/form.php and based on the example you provided, that any 
unknown parameters in the options array are passed through as HTML attributes 
of the form tag. Check the documentation: "id" and "controller" are unknown 
parameters in the options array.

http://book.cakephp.org/view/183/Creating-Forms


Assuming you meant for the id to be passed through to the HTML form element, 
and that you meant for the form's action to go to the CakePHP URL corresponding 
to the registration action of the users controller, I think you meant:

<?php echo $this->Form->create('User', array('id' => 'Registration', 'url' => 
array('controller' => 'users', 'action' => 'registration'))); ?>

That's assuming you're not already in the users controller now. If you already 
are, then just don't specify the controller:

<?php echo $this->Form->create('User', array('id' => 'Registration', 'action' 
=> 'registration')); ?>



Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to