php - how to link javascript to $scripts_for_layout while in an element -


I am currently working on an application that will implement the user optimization widget on every user dashboard. The user is able to add and delete widgets. Each widget is contained in its own element and some have javascript files, which are to be loaded individually.

If I try to put JavaScript in the $ scripts_for_layout using the following code, nothing will happen in an element.

  & lt ;? Php $ javascript- & gt; Link ('widgets / blogs', wrong); ? & Gt;  

After seeing a bit in the cakepack bug tracker, which tells why and a commentator also suggested a workaround that could be around it:

  & lt ;? Php echo join ("\ n \ t", $ this-> __script); ? & Gt;  

I tried to use it but it does not seem to work. Does anyone know any other solutions for this issue or even better how to do this?

I 'I'm not sure why $ javascript- & gt; The link (..., false) should not work in an element, but you can try it:

  $ this -> AddScript ($ javascript & gt; link ('path / to / script'));  

It should work in a scene. In a layout, as mentioned in the bug that you are linking to, this will not work, since the header script will already be output from the time provided by the element.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -