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?

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Just to help others. "Please add the statement in your required view file".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.