See: http://groups.google.com/group/cake-php/msg/3a0042bc4063ed68?hl=en
The documentation you're reading is for a newer version of Cake.
On 9 Sep 2008, at 15:56, wael altahawi wrote:
> Thanks for your answer i m working on cake_1.1.19
> i have included
> var $helpers = array('Form', 'Html', 'Javascript');
> but also i get
>
> *Fatal error*: Call to undefined method FormHelper::create() in *
> c:\AppServ\www\applogic\app\views\users\index.ctp* on line *1*
>
>
>
> On Tue, Sep 9, 2008 at 10:16 AM, Kalt <[EMAIL PROTECTED]>
> wrote:
>
>>
>> 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
-~----------~----~----~----~------~----~------~--~---