I wish to add some script to a view and have it que and load at the bottom of the page within the default layout. At the moment it runs before query is loaded and causes an error.
I am using cakephp 2.5
Is there a way to buffer it?
myview.ctp:
<script type="text/javascript">
FWDEVPUtils.onReady(function(){
FWDEVPlayer.useYoutube = "yes";
FWDEVPlayer.videoStartBehaviour = "pause";
new FWDEVPlayer({
//main settings
instanceName:"player",
parentId:"player",
mainFolderPath:"content"
});
});
default.ctp
echo $this->Html->script('//code.jquery.com/jquery-1.10.2.min.js');
echo $this->Html->script('bootstrap.min');
echo $this->Html->script('FWDEVPlayer');
echo $this->fetch('script');
echo $this->Js->writeBuffer();