For instance, depending upon various optional data in the model the headLink
may generate an RSS link, various CSS links dependent upon theme options,
etc.
Same deal with the headTitlel. The user may or may not have entered in
title/subtitle data as well as geographical data (city, state, zip, etc).
Matthew Weier O'Phinney-3 wrote:
>
> -- Matthew Lurz <mlurz71@gmail.com> wrote
> (on Sunday, 16 November 2008, 09:36 PM -0800):
>>
>> I have some headLink and headTitle logic that's a little out of control
>> and
>> so wanted to separate this logic out of my layout scripts.
>>
>> I thought that I could simply extend the Zend_View helper and return an
>> instance of my custom class but this didn't seem to work and so I just
>> extended Zend_View_Helper_Abstract. The problem with this is that I end
>> up
>> with calls to both $this->head() (my custom view helper) and
>> $this->headLink() in my layout scripts. Instead I would simply like to be
>> able to call $this->headLink().
>>
>> Is a custom view helper not the way to go here since this is a
>> placeholder
>> (I haven't really wrapped my head around placeholders just yet). Thanks!
>
> Each publically exposed placeholder view helper utilizes a container
> object beneath it. In all liklihood, you may need to extend both of
> these to get the functionality you need. However, it's unclear what
> sorts of things you're needing to extend the helper to do, so I can't be
> more specific in my advice. Can you give some examples?
>
> --
> Matthew Weier O'Phinney
> Software Architect | matthew@zend.com
> Zend Framework | http://framework.zend.com/
>
>
--
View this message in context: http://www.nabble.com/Extending-View-Helpers-tp20534060p20538929.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论