-- SiCo007 <[EMAIL PROTECTED]> wrote
(on Tuesday, 04 March 2008, 03:43 PM -0800):
> Hi, can you tell me if this is the best way to use the placeholder view
> helpers in my actions and plugins.
> 
> I have a simple skin manager built on top of Zend_Layout. I.e. the module
> admin file has a skin name, the plugin extends the Zend_Layout plugin,
> selects the skin variable and then fires the Zend_Layout plugin with the
> values for the skin as the layout path.
> 
> I want a default CSS to be added (i.e. screen stylesheet), I am doing:
> 
> $view =
> Zend_Controller_Action_HelperBroker::getExistingHelper('ViewRenderer')->view;
> $view->headLink()->prependStylesheet('pathto/styles/screen.css');
> 
> Are there action helper counterparts to this view helpers as it would seem
> to me it might be useful to set title, css etc in the action itself? I may
> of overlooked this?...

Well, you have access to the view from the action already. :-)

    $this-view->headLink()->prependStylesheet('pathto/styles/screen.css');

HTH. 

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to