Páginas

12 de fevereiro de 2010

Numa listagem do admin generator criar um link para um módulo e acção diferentes

Criar o método para devolver o link, no modelo que estamos a trabalhar:
public function getArticleLink()
{
  return link_to($this->getArticle()->getTitle(), 'article/edit?id='.$this->getArticleId());
}

No generator.yml colocar a entrada respectiva:
generator:
  class:              sfPropelAdminGenerator
  param:
    model_class:      Comment
    theme:            default

    fields:
      id:             { name: Id }
      article_link:   { name: Article }
      author:         { name: Author }
      date:           { name: Published on }
      content:        { name: Body }

    list:
      display:        [id, article_link, date]
      ... 


Retirado daqui:
http://vit.free.fr/symfony/0.6.3/generator.html

Nenhum comentário:

Postar um comentário