Hi there,

What I did was this:

make a file: apps/frontend/lib/titleFilter.php
<?php
class titleFilter extends sfFilter
{
  /**
   * This filter replaces the title
   *
   * filters.yml config
   * title:
   *   class: titleFilter
   *   param:
   *     title: <title>
   *     position: before | {after}
   *
   * @param sfFilter $filterChain
   */
  public function execute($filterChain)
  {
    $filterChain->execute();
    $rs = $this->getContext()->getResponse();
    $tag = '</title>';
    $replace = $this->getParameter('title').$tag;
    if ($this->GetParameter('position') == 'first' || $this-
>getParameter('position') == 'before')
    {
      $tag = '<title>';
      $replace = $tag.$this->getParameter('title');
    }
    $rs->setContent(str_ireplace($tag, $replace, $rs->getContent()));
  }
}


Then, in apps/frontend/config/filters.yml:

# generally, you will want to insert your own filters here
title:
  class: titleFilter
  param:
    title: ' | App Title'
    position: last

Then you just use view.yml's template_metas: to give the title for
that view.

As for i18n, i'm sure there's something you could do to further this
and be good to go :)

On Jul 11, 1:34 pm, Jorge Laranjo <[EMAIL PROTECTED]> wrote:
> Hi! I've got one title to the "application" and then in some modules
> I want to add something to that title
>
> actionSuccess:
>    metas:
>      title: I want to add this string
>
> What I want is a manner so if I change the "global" title then the
> other ones will fit to this new string, ie:
>
> title on the view.yml of the app
> "title of the app"
>
> title on the module A action
> "title of the app" + "module A action"
>
> If I change the "app" title to "app title" then the module A action
> should change to "app title" + "module A action"
>
> Can I do this on the YML file? And if I want i18n ? Thanks.
>
> --
> Atentamente,
> Jorge Laranjo
>
> [EMAIL PROTECTED]://jorge.laranjo.eu
> ---------------------------------------------------------
> Esta mensagem foi assinada digitalmente
> ---------------------------------------------------------
>
>  smime.p7s
> 3KDownload


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to