4

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?

Keyur Padalia
  • 2,077
  • 3
  • 28
  • 55

1 Answers1

3

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.

drmonkeyninja
  • 8,490
  • 4
  • 31
  • 59