Re: can not find javascripthelper

2009-03-04 Thread brian

On Wed, Mar 4, 2009 at 2:44 AM, loong  wrote:
>
> Hi all, I am new to cakephp. Maybe this problem is simple, but please
> help me. I have a hotels_controller.php:
>
>  class HotelsController extends AppController {
>        var $scaffold;
>
>        var $helpers = array("Javascript");
>
>        function index() {
>
>        }
> }
> ?>
>
> and in the /app/views/layouts/default.ctp, there is
>
> link("main"); ?>
>
> and there is an empty view  /app/views/hotels/index.ctp
>
> but I get error msg:
>
> Notice (8): Undefined variable: javascript [APP\views\layouts
> \default.ctp, line 1581]


This is because the controller's $helpers were not loaded. See below:

> Code | Context
>
> $___viewFn      =       
> "E:\xampp\htdocs\booking\app\views\layouts\default.ctp"
> $___dataForView =       array(
>        "controller" => "HotelController",
>        "controllerName" => "Hotel",
>        "title_for_layout" => "Missing Controller",
>        "content_for_layout" => "Missing Controller
> 
>        Error: 
>        HotelController could not be found.
> 
>        Error: 
>        Create the class HotelController below in file: app
> \controllers\hotel_controller.php
> 
>  class HotelController extends AppController {
>
>        var $name = 'Hotel';
> }
> ?>
> 

Cake is looking for a class named HotelController, but you have a
HotelsController. The latter is the "correct" naming convention,
though. So, it's possible that you have an incorrect route. What's the
URL you're using to get to this page, and do you have a route for it?

Also, do you really have more than 1581 lines in your default
layout?!? I'm wondering if that's a Cake boo-boo.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



can not find javascripthelper

2009-03-04 Thread loong

Hi all, I am new to cakephp. Maybe this problem is simple, but please
help me. I have a hotels_controller.php:



and in the /app/views/layouts/default.ctp, there is

link("main"); ?>

and there is an empty view  /app/views/hotels/index.ctp

but I get error msg:

Notice (8): Undefined variable: javascript [APP\views\layouts
\default.ctp, line 1581]

Code | Context

$___viewFn  =   "E:\xampp\htdocs\booking\app\views\layouts\default.ctp"
$___dataForView =   array(
"controller" => "HotelController",
"controllerName" => "Hotel",
"title_for_layout" => "Missing Controller",
"content_for_layout" => "Missing Controller

Error: 
HotelController could not be found.

Error: 
Create the class HotelController below in file: app
\controllers\hotel_controller.php




Notice: 
If you want to customize this error message, create app\views\errors
\missing_controller.ctp",
"scripts_for_layout" => "",
"cakeDebug" => "",
"html" => HtmlHelper
HtmlHelper::$tags = array
HtmlHelper::$base = "/booking"
HtmlHelper::$here = NULL
HtmlHelper::$params = array
HtmlHelper::$action = NULL
HtmlHelper::$data = array
HtmlHelper::$_crumbs = array
HtmlHelper::$__docTypes = array
HtmlHelper::$helpers = NULL
HtmlHelper::$webroot = "/booking/"
HtmlHelper::$themeWeb = NULL
HtmlHelper::$plugin = NULL
HtmlHelper::$namedArgs = NULL
HtmlHelper::$argSeparator = NULL
HtmlHelper::$validationErrors = NULL
HtmlHelper::$__tainted = NULL
HtmlHelper::$__cleaned = NULL
HtmlHelper::$_log = NULL,
"form" => FormHelper
FormHelper::$helpers = array
FormHelper::$fieldset = array
FormHelper::$__options = array
FormHelper::$fields = array
FormHelper::$requestType = NULL
FormHelper::$base = "/booking"
FormHelper::$webroot = "/booking/"
FormHelper::$themeWeb = NULL
FormHelper::$here = NULL
FormHelper::$params = array
FormHelper::$action = NULL
FormHelper::$plugin = NULL
FormHelper::$data = array
FormHelper::$namedArgs = NULL
FormHelper::$argSeparator = NULL
FormHelper::$validationErrors = NULL
FormHelper::$tags = array
FormHelper::$__tainted = NULL
FormHelper::$__cleaned = NULL
FormHelper::$_log = NULL
FormHelper::$Html = HtmlHelper object,
"session" => SessionHelper
SessionHelper::$helpers = NULL
SessionHelper::$__active = true
SessionHelper::$valid = false
SessionHelper::$error = false
SessionHelper::$_userAgent = "644aff775060fb52a3ee411e4ab5015b"
SessionHelper::$path = "/"
SessionHelper::$lastError = NULL
SessionHelper::$security = NULL
SessionHelper::$time = 1236152562
SessionHelper::$sessionTime = false
SessionHelper::$watchKeys = array
SessionHelper::$id = NULL
SessionHelper::$_log = NULL
SessionHelper::$base = "/booking"
SessionHelper::$webroot = "/booking/"
SessionHelper::$here = NULL
SessionHelper::$params = array
SessionHelper::$action = NULL
SessionHelper::$data = array
SessionHelper::$themeWeb = NULL
SessionHelper::$plugin = NULL
)
$loadHelpers=   false
$cached =   true
$loadedHelpers  =   array()
$controller =   "HotelController"
$controllerName =   "Hotel"
$title_for_layout   =   "Missing Controller"
$content_for_layout =   "Missing Controller

Error: 
HotelController could not be found.

Error: 
Create the class HotelController below in file: app
\controllers\hotel_controller.php




Notice: 
If you want to customize this error message, create app\views\errors
\missing_controller.ctp"
$scripts_for_layout =   ""
$cakeDebug  =   ""
$html   =   HtmlHelper
HtmlHelper::$tags = array
HtmlHelper::$base = "/booking"
HtmlHelper::$here = NULL
HtmlHelper::$params = array
HtmlHelper::$action = NULL
HtmlHelper::$data = array
HtmlHelper::$_crumbs = array
HtmlHelper::$__docTypes = array
HtmlHelper::$helpers = NULL
HtmlHelper::$webroot = "/booking/"
HtmlHelper::$themeWeb = NULL
HtmlHelper::$plugin = NULL
HtmlHelper::$namedArgs = NULL
HtmlHelper::$argSeparator = NULL
HtmlHelper::$validationErrors = NULL
HtmlHelper::$__tainted = NULL
HtmlHelper::$__cleaned = NULL
HtmlHelper::$_log = NULL
$form   =   FormHelper
FormHelper::$helpers = array
FormHelper::$fieldset = array
FormHelper::$__options = array
FormHelper::$fields = array
FormHelper::$requestType = NULL
FormHelper::$base = "/booking"
FormHelper::$webroot = "/booking/"
FormHelper::$themeWeb = NULL
FormHelper::$here = NULL
FormHelper::$params = array
FormHelper::$action = NULL
FormHelper::$plugin = NULL
FormHelper::$data = array
FormHelper::$namedArgs = NULL
FormHelper::$argSeparator = NULL
FormHelper::$validationErrors = NULL
FormHelper::$tags = array
FormHelper::$__tainted = NULL
FormHelper::$__cleaned = NULL
FormHelper::$_log = NULL
FormHelper::$Html = HtmlHelper object
$session=   SessionHelp