开发者

accessing a javascript/css from within zend framework's application directory

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 i开发者_开发知识库t will complain that it can't find the 'application' controller...


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜