"You can't use JavascriptHelper::link from an element to insert
scripts into the header;"

Assuming you mean the HTML <head></head> section, I'm not sure where
you're coming from. I do it often without problems. As I understand
it, code inside an element acts in the same scope as the view. IE
anything you can do in the view, you can do in an element.



On Jul 23, 11:33 am, jperras <[email protected]> wrote:
> You can't use JavascriptHelper::link from an element to insert scripts
> into the header; this is a fundamental constraint imposed by the two-
> step render engine (http://martinfowler.com/eaaCatalog/twoStepView.html
> ).
>
> There are some ways around this using the class registry, but that's
> mostly meant for use in custom helpers that need to insert scripts
> into the header.
>
> -jperras.
>
> On Jul 23, 2:46 am, Yannis <[email protected]> wrote:
>
> > Thanks guys,
> > The thing is that scripts_for_layouts is in an element that I include
> > in the layout.
> > And this is for the simple reason that the head elements of the page
> > are included there.
>
> > I will try and include the scripts_for_layouts outside the head of the
> > html page.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to