0

so suppose inside the views/scripts directories within the application folder of my zend framework project, I would like to put in javascript/css files and then I would like to add these to my pages...

what would be the best way in doing so since if I just put in the full path to the file it will complain that it can't find the 'application' controller...

1 Answer 1

2

JavaScript and CSS (and images, flash and any other public, static asset) should go under the public directory.

You reference these in your view / layout using the appropriate view helper

<?php echo $this->headScript()->appendFile(
        $this->baseUrl('path/to/script.js')) ?>

If you must place these in your application directory, consider creating symbolic links under the public directory.

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

Comments

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.