change
echo $this->form->create('Post');
to
echo $form->create('Post');
Form is a helper so that u can't access like $this->form. U can easily
access it like $form if u declare it in the $helpers array of the
controller.
On Mon, May 19, 2008 at 7:49 PM, hi zahir <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> i am new in cake. i wan trying the blog example in online manual.
>
> according to manual i created a view called:
> /app/views/posts/add.ctp
>
> and added following code:
> /app/views/posts/add.ctp
>
> <h1>Add Post</h1>
> <?php
> echo $this->form->create('Post');
> print $form->input('title');
> print $form->input('body',array('rows'=>'3'));
> print $form->end('Save Post');
> ?>
>
> but when i click 'Add Post' from index view, it shows following
> message.
>
> as per document $form object should be available in view. but it seems
> to me, it is not. may be i missed something.
>
>
> /app/views/posts/add.ctp
> Add Post
>
> Notice: Undefined property: View::$form in C:\wamp\www\cake\app\views
> \posts\add.ctp on line 5
>
> Fatal error: Call to a member function create() on a non-object in C:
> \wamp\www\cake\app\views\posts\add.ctp on line 5
>
>
>
> could anyone give me any advice please?
>
>
>
> thanks
>
> >
>
--
Best Regards,
Tapos Pal
http://tapos.wordpress.com
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---