Hi all, I am new to cakephp. Maybe this problem is simple, but please
help me. I have a hotels_controller.php:
<?php
class HotelsController extends AppController {
var $scaffold;
var $helpers = array("Javascript");
function index() {
}
}
?>
and in the /app/views/layouts/default.ctp, there is
<?php echo $javascript->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" => "<h2>Missing Controller</h2>
<p class="error">
<strong>Error: </strong>
<em>HotelController</em> could not be found.</p>
<p class="error">
<strong>Error: </strong>
Create the class <em>HotelController</em> below in file: app
\controllers\hotel_controller.php</p>
<pre>
<?php
class HotelController extends AppController {
var $name = 'Hotel';
}
?>
</pre>
<p class="notice">
<strong>Notice: </strong>
If you want to customize this error message, create app\views\errors
\missing_controller.ctp</p>",
"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 = "<h2>Missing Controller</h2>
<p class="error">
<strong>Error: </strong>
<em>HotelController</em> could not be found.</p>
<p class="error">
<strong>Error: </strong>
Create the class <em>HotelController</em> below in file: app
\controllers\hotel_controller.php</p>
<pre>
<?php
class HotelController extends AppController {
var $name = 'Hotel';
}
?>
</pre>
<p class="notice">
<strong>Notice: </strong>
If you want to customize this error message, create app\views\errors
\missing_controller.ctp</p>"
$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
</div>
</div>
<?php echo $javascript->link("main"); ?>
include - APP\views\layouts\default.ctp, line 1581
View::_render() - CORE\cake\libs\view\view.php, line 662
View::renderLayout() - CORE\cake\libs\view\view.php, line 450
View::render() - CORE\cake\libs\view\view.php, line 388
Controller::render() - CORE\cake\libs\controller\controller.php, line
774
ErrorHandler::_outputMessage() - CORE\cake\libs\error.php, line 373
ErrorHandler::missingController() - CORE\cake\libs\error.php, line 174
Object::dispatchMethod() - CORE\cake\libs\object.php, line 117
ErrorHandler::__construct() - CORE\cake\libs\error.php, line 118
Object::cakeError() - CORE\cake\libs\object.php, line 202
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 146
[main] - APP\webroot\index.php, line 88
why can't it find the helper?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---