ZF-2161: Zend_View::javascript(), Zend_View::css()
Description
Not sure if this is possible (to discern locations of javascript and/or css files from Zend_View), but here are a couple use-cases describing what these methods might do:
<?php echo $this->javascript('jquery.js');?> outputs:
<?php echo $this->css('site.css');?> outputs:
Unsure if there should be conventional defaults (convention of document_root/ or whatever)?
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2007-11-16T12:28:04.000+0000
Not settng a release for this, as I want more discussion/votes before committing to it. Regardless, if implemented, these would be as view helpers, not as direct methods of Zend_View, and most likely would either need settings in the Registry for the locations, or require the user to pass in the base paths.
Posted by Luke Crouch (lcrouch) on 2007-11-16T14:23:21.000+0000
ah yes ... I think view helpers is a great idea.
is there a conventional default ZF directory/file layout yet? so we could set defaults in a registry setting for these?
Posted by Jon Whitcraft (sidhighwind) on 2008-01-09T13:23:09.000+0000
Isn't this already one with the inclusing of the Head* view helpers?
Posted by Matthew Weier O'Phinney (matthew) on 2008-01-09T15:09:14.000+0000
This functionality, except for the explicit directory structure, is now part of the Zend_View Enhanced view helpers, specifically the headLink(), headStylesheet(), and headScript() helpers.