Open app_controller.php and add the following line:

var $helpers = array('Html', 'Form', 'Session');

On Jul 12, 8:01 pm, sologroupmc <[EMAIL PROTECTED]> wrote:
> I've got cake 1.2 installed and am trying the 15 min blog tutorial.
> When I originally set up the add() in the post view, it barked about
> all the deprecated $html helper functions and would not recognize a
> $html->submit function.  So I found all the changes in the API, moving
> toward $form and implemented them (I think).
>
> Problem is, cake does not even recognize the $form helper when
> executing the add() view.  Here is the codeL
>
> <h1>Add Post</h1>
> <form method="post" action="<?php echo $html->url('/posts/add')?>">
>     <p>
>         Title:
>         <?php echo $form->input('Post.title', array('size' => '40'))?>
>         <?php echo $form->error('Post.title', 'Title is required.') ?>
>     </p>
>
> And here is the error I get (DEBUG config is set to level 3):
>
> Add Post
>
> Title:
>
> Notice (8): Undefined variable: form [CORE/app/views/posts/add.thtml,
> line 5]
> Context | Code
> $this   =       View object
> $___viewFn      =       "/Users/mc/Sites/cake_1.2.0.5427alpha/app/views/posts/
> add.thtml"
> $___dataForView =       array()
> $loadHelpers    =       true
> $cached =       false
> $loadedHelpers  =       array("Html" => HtmlHelper object, "Session" =>
> SessionHelper object)
> $helper =       SessionHelper object
> $replace        =       "s"
> $camelBackedHelper      =       "session"
> $html   =       HtmlHelper object
> $session        =       SessionHelper object
> $BASE   =       "/~mcheck/cake"
> $params =       array("pass" => array, "controller" => "posts", "action" =>
> "add", "form" => array, "url" => array, "bare" => 0, "webservices" =>
> null, "plugin" => null, "models" => array)
> $page_title     =       false
> include - CORE/app/views/posts/add.thtml, line 5
> View::_render() - CORE/cake/libs/view/view.php, line 772
> View::render() - CORE/cake/libs/view/view.php, line 337
> Controller::render() - CORE/cake/libs/controller/controller.php, line
> 663
> Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 356
> Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 333
> [main] - CORE/app/webroot/index.php, line 83
>
> Fatal error: Call to a member function input() on a non-object in /
> Users/mc/Sites/cake_1.2.0.5427alpha/app/views/posts/add.thtml on line
> 5
>
> So I see there that the FormHelper object is non-existant.  Am I
> supposed to instantiate it somewhere?
>
> Thanks in advance,
>
> mc


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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