headTitle view helper append

3 messages Options
Embed this post
Permalink
umpirsky

headTitle view helper append

Reply Threaded More More options
Print post
Permalink
Hi.

I have in my layout.phtml

<?= $this->headTitle('site.com')->setSeparator(' > ') ?>

in my view script I have

<?= $this->headTitle('my view') ?>

This generates title

<title>my view > site.com</title>

I expected <title> site.com > my view</title> since default set is Zend_View_Helper_Placeholder_Container_Abstract::APPEND. Looks like layout is appending title to view?

Regards,
Saša Stamenković.
Hector Virgen

Re: headTitle view helper append

Reply Threaded More More options
Print post
Permalink
That's correct, because the layout is processed after the view is processed. You may want to use a bootstrap _init method to set your site's title so that it happens early (before views are processed).

--
Hector


On Tue, Oct 20, 2009 at 1:03 AM, umpirsky <[hidden email]> wrote:

Hi.

I have in my layout.phtml

<?= $this->headTitle('site.com')->setSeparator(' > ') ?>

in my view script I have

<?= $this->headTitle('my view') ?>

This generates title

<title>my view &gt; site.com</title>

I expected <title> site.com &gt; my view</title> since default set is
Zend_View_Helper_Placeholder_Container_Abstract::APPEND. Looks like layout
is appending title to view?

Regards,
Saša Stamenković.
--
View this message in context: http://www.nabble.com/headTitle-view-helper-append-tp25971209p25971209.html
Sent from the Zend MVC mailing list archive at Nabble.com.


umpirsky

Re: headTitle view helper append

Reply Threaded More More options
Print post
Permalink
Yes, it's logical, because view content is injected into layout. Thx.

Regards,
Saša Stamenković


On Tue, Oct 20, 2009 at 5:29 PM, Hector Virgen <[hidden email]> wrote:
That's correct, because the layout is processed after the view is processed. You may want to use a bootstrap _init method to set your site's title so that it happens early (before views are processed).

--
Hector



On Tue, Oct 20, 2009 at 1:03 AM, umpirsky <[hidden email]> wrote:

Hi.

I have in my layout.phtml

<?= $this->headTitle('site.com')->setSeparator(' > ') ?>

in my view script I have

<?= $this->headTitle('my view') ?>

This generates title

<title>my view &gt; site.com</title>

I expected <title> site.com &gt; my view</title> since default set is
Zend_View_Helper_Placeholder_Container_Abstract::APPEND. Looks like layout
is appending title to view?

Regards,
Saša Stamenković.
--
View this message in context: http://www.nabble.com/headTitle-view-helper-append-tp25971209p25971209.html
Sent from the Zend MVC mailing list archive at Nabble.com.