-1
誰能告訴我如何在CakePHP插件中包含js庫? 在根應用程序/文件夾中,我可以在Config/assets.php中做到這一點,但是我在哪裏可以將它包含在插件中?如何在CakePHP插件中包含js庫
,我想包括位於/應用/插件/ MyModule的/ webtoor/JS/lib中/
誰能告訴我如何在CakePHP插件中包含js庫? 在根應用程序/文件夾中,我可以在Config/assets.php中做到這一點,但是我在哪裏可以將它包含在插件中?如何在CakePHP插件中包含js庫
,我想包括位於/應用/插件/ MyModule的/ webtoor/JS/lib中/
您可以使用塊腳本和CSS文件的庫。更多的信息在這裏:http://book.cakephp.org/2.0/en/views.html#using-blocks-for-script-and-css-files
Short answer:
// in your view
$this->Html->script('/pluginName/js/lib/whatever', array('block' => 'scriptBottom'));
// in your layout
echo $this->fetch('scriptBottom');
這應該做的伎倆。