Sgn.
Sgn.

Reputation: 1696

Symfony 1.4 - Do something before checking credentials

I have some credential requirements for my modules in security.yml. How can i run a method before this checking is done? Is there any events for doing this?

Upvotes: 1

Views: 201

Answers (1)

Samy Dindane
Samy Dindane

Reputation: 18706

Filters might be what you need.
Filters are run first every time your application runs.

Just add a filter in the apps/(front|back)end/config/filters.yml file:

myFilter:
  class: myFilter

And create the class in lib/:

class myFilter extends sfFilter
{
  public function execute($filterChain)
  {
    // write your code here...

    // execute the next filter
    $filterChain->execute();
  }
}

Upvotes: 5

Related Questions