Hi,

You have to include the FormHelper first, in your UsersController or
in the AppController :
var $helpers = array('Form', 'Html', 'Javascript');

But in the last version of Cake, it's included automatically. What
version are you working with ?

wael altahawi a écrit :
> hi
> i m trying to execute code from example in one book but i get error
> if there is error in code please help me
>
>
> (index.ctp)
> <?php echo $form->create(null, array('action' => 'index'));?>
> <fieldset>
> <legend>Enter Your Name</legend>
> <?php echo $form->input('name'); ?>
> </fieldset>
> <?php echo $form->end('Go');?>
>
> (users_controller.php)
> <?php
> class UsersController extends AppController {
> var $name = 'Users';
> var $uses = array();
> function index() {
> if (!empty($this->data)) {
> //data posted
> echo $this->data['name'];
> $this->autoRender = false;
> }
> }
> }
> ?>
>
> and i put http://localhost/applogic/users/
> and get the error :
>
> *Notice*: Undefined variable: form in *
> c:\AppServ\www\applogic\app\views\users\index.ctp* on line *1*
>
> *Fatal error*: Call to a member function create() on a non-object in *
> c:\AppServ\www\applogic\app\views\users\index.ctp* on line *1*
--~--~---------~--~----~------------~-------~--~----~
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