As long as you have $scripts_for_layout in the head of your layout file:

echo $javascript->link('some_file_without_extension', false);

The second param tells Cake not to write the script tag in the body
(even though you're echoing), but instead pass it to
$scripts_for_layout (the view is rendered before the layout wrapper).

If you want a code block:

echo $javascript->codeBlock($code, array('inline' => false));

Set 'inline' to true if you want the code block printed in your view
instead of the head.

On Thu, Mar 5, 2009 at 12:40 AM, Matthieu <matthieu.aussag...@gmail.com> wrote:
>
> How, I dont know how to include a js file or code for one specific
> view. The only way I found to include js files is to do it in the
> layout..
>
> Thks for the help
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to