简体   繁体   中英

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

I have CakePHP 1.3 setup like following app -config -controllers -lib -models -views -webroot -css -files -js

Now to include a javascript file in my view file(.ctp) I know that i have to do

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

and it will include it but if i want to include any php file from the files directory which is under webroot folder is there any cakePHP method or helper i can use or do i just require_once?

If the PHP file is independent of CakePHP then just use require_once :-

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

There is no need to complicate it further than that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM