korvinko
korvinko

Reputation: 700

Run method before all controllers symfony2

I want to run transparently it method before all controllers. How I need to do this?

protected function getFrontBreadcrumb()
{
    $breadcrumbs = $this->get("white_october_breadcrumbs");
    $breadcrumbs->addItem("Главная", $this->get("router")->generate("front"));
}

Upvotes: 0

Views: 194

Answers (1)

John WH Smith
John WH Smith

Reputation: 2773

You must use event listeners :)

http://symfony.com/doc/current/book/internals.html#events

Be careful not to ask questions that were already answered on Stack Overflow ^^

Upvotes: 2

Related Questions