I create a default layout and added css and javascript into it like
the following,
For CSS I added the following lines in the head section of the
default.ctp in layout folder
echo $html->css('reset', 'stylesheet', array("media"=>"screen"))."\r
\n ";
echo $html->css('style', 'stylesheet', array("media"=>"screen"))."\r
\n ";
echo $html->css('invalid', 'stylesheet', array("media"=>"screen"))."\r
\n\r\n ";
It worked finely.
Then I need to add javascript functionality
So I added a line like this after the above code
<!-- Javascripts -->
<!-- jQuery -->
<?php
echo $javascript->link(array('jquery-1.3.2.min'));
?>
I copy jquery-1.3.2.min to the default webroot/js folder (followed the
cakephp convention)
But I got a warning message like this:
Notice (8): Undefined variable: javascript [APP\views\layouts
\default.ctp, line 26]
Fatal error: Call to a member function link() on a non-object in D:
\xampp\htdocs\cakephp127\app\views\layouts\default.ctp on line 26
I even use $javascript->includeScript() but again I got the same
warning
I can't able to use the javascript functionality,
I am new to cakephp, so I want to know where I am making mistake.
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
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