dinsdag 4 maart 2008

How to use $scripts_for_layout

Finally discovered how $scripts_for_layout works.

I have put

< ?php echo $javascript->link('jtip', false); ?>

in my view. False just means do not put it here, but put it where $scripts_for_layout is in my layout, so in the header.

Still looking for a way to have js scripts automatically included. It exists, but I still haven't found what I'm looking for... Anyone?

8 opmerkingen:

  1. [...] How to use $scripts_for_layout | CakePHP Tips (tags: cakephp javascript) [...]

    BeantwoordenVerwijderen
  2. Cheers. Really concise explanation.

    BeantwoordenVerwijderen
  3. [...] I wrote about $scripts_for_layout and I was looking for a solution to automatically load js files into your layout. Well, I think the [...]

    BeantwoordenVerwijderen
  4. @ ADMIN
    Hey, uma observation. No need add echo, only < ? php $javascript->link( 'jtip', fase ); ? >

    Falopa!

    BeantwoordenVerwijderen
  5. and how to code in cakephp version 2.x?

    BeantwoordenVerwijderen