如何包含来自名为“”的目录的php文件;文件”;在CakePHP 1.3文件夹结构中


How to include a php file from directory named "files" in CakePHP 1.3 folder structure?

我有如下CakePHP 1.3设置应用程序配置-控制器-lib-模型-视图-webroot-css-文件-js

现在要在我的视图文件(.ctp)中包含一个javascript文件,我知道我必须执行

echo $this->Html->script('manage_products');

它会包含它,但如果我想包含webroot文件夹下files目录中的任何php文件,有没有我可以使用的cakeHP方法或助手,或者我只需要一次?

如果PHP文件独立于CakePHP,那么只需使用require_once:-

<?php require_once WWW_ROOT . DS . 'files' . DS . 'foobar.php'; ?>

没有必要比这更复杂。