Glk - for $this->Html->script(), you can achieve this by using the "once"
option in the second argument, e.g.:
$this->Html->script('jquery.js', array('once' => true));
For more info
see:
http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::script
For whatever reason, the css() method doesn't have the same option (may the
checking is done automatically?), but that'll solve the script problem
anyway.
- Jamie
On Sunday, August 4, 2013 10:35:58 AM UTC-7, glk wrote:
>
> Hello all, I've got more of a cake design question that a problem (at this
> point anyway).
>
> I'm using the htmlHelper and the $this->Html->css and $this->Html->script
> to make sure all the jquery and other stuff gets loaded properly. My
> problem arose when I was using .load() to pull a different
> controller/action onto a jquery tab. The new controller/action also
> included the very same jquery scripts in to the "tab". Of course, this
> lead to many problems with all of the javascript.
>
> I would suggest here that the htmlHelper should have the ability to make
> sure that the css, scripts, and maybe even the meta should use some sort of
> singleton pattern to make sure they never get loaded more than once.
>
> In my particular case, it was easily fixed, but I can envision situations
> where I might not have control of the information on the "loaded" page
> information.
>
> Thanks for listening, and keep of the great work... I really enjoy working
> with the cakePHP framework.
>
>
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.