143
rated 0 times
[
144]
[
1]
/ answers: 1 / hits: 21006
/ 10 Years ago, wed, october 22, 2014, 12:00:00
The cakephp docs say:
By default, script tags are added to the document inline. If you override this by setting $options['inline'] to false, the script tags will instead be added to the script block which you can print elsewhere in the document.
So in my view file (.ctp) I have:
echo $this->Html->script('//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js', array('inline' => 'false'));
And in my layout, in the head tag:
echo $this->fetch('script');
But the script tag prints out inline and not in the head. If I miss of the echo from the line in my view file, the script doesn't print out at all in my html.
Any help would be gratefully received.
PAE
More From » php