Login Register


Place javascript script for each individual element being loaded cakephp

In order to display an individual javascript file for each spesific element in Cakephp, in the layout put:

<?php echo $scripts_for_layout; ?>

Then in the element you can call the javascript file you need to include, like so:

Html->script("js_file", array("inline"=>false)); ?>

Posted on: 2016-06-01 Please login/register to leave comments