在我看来,当使用<?php echo $this->Html->script('script.js'); ?>
包含脚本时,一切正常。但是,如果我将文件名更改为'script.min.js',则URL呈现正常,但CakePHP拒绝提供脚本,而是返回:
Warning (2): include(/home/example/public_html/app/View/Themed/Type1/webroot/js/script.min.js): failed to open stream: Permission denied [CORE/Cake/Routing/Filter/AssetDispatcher.php, line 161]
Warning (2): include() [http://php.net/function.include]: Failed opening '/home/example/public_html/app/View/Themed/Type1/webroot/js/jquery.min.js' for inclusion (include_path='/home/example/public_html/lib:.:/usr/share/php:/usr/share/pear') [CORE/Cake/Routing/Filter/AssetDispatcher.php, line 161]
我尝试了<?php echo $this->Html->script('script.min.js'); ?>
和<?php echo $this->Html->script('script.min.js', array('plugin' => false); ?>
,但到目前为止都没有。
这是什么解决方法?