tags:

views:

552

answers:

2

hi , I m creating just creating a register form in cakephp .. On using the follwing code in my view

<?php echo $form->create('User', array('url' => array('action' => 'register'))); ?>
<?php echo $form->input('User.name', array('type'=>'text')); ?>
<?php echo $form->end(); ?>

Will displays errors as

$model = "Form"</pre><pre>sprintf - [internal], line ??
FormHelper::hidden() - CORE/cake/libs/view/helpers/form.php, line 1021
FormHelper::create() - CORE/cake/libs/view/helpers/form.php, line 214
    include - APP/views/forms/index.ctp, line 5
    View::_render() - CORE/cake/libs/view/view.php, line 662

Please resolve it

A: 

Try this:

echo $form->create('User', array('url' => '/users/register'));
ByteNirvana
Or even array('url' => array('controller'=>'users','action'=>'register')); !
DavidYell
+2  A: 

This also works:

echo $form->create('User', array('action' => 'register'));
rnavarro