Answer the question
In order to leave comments, you need to log in
Is it possible to set default filters for all controllers?
I have a redirect filter (previously it was just a helper and was executed in beforeAction in the Controller from which all controllers were extended), but I ran into a problem that filters are executed before beforeAction, and the filter still looks more beautiful than the behaver. So the question arose of what to do really beautifully and completely forget about these SEO things and make this filter the default, are there any options?
Answer the question
In order to leave comments, you need to log in
We take the parent controller:
public function filters()
{
return array(
'ie',
'language',
'banned',
'eraserecovery',
'empty',
'clearban',
'jsCookie',
'css',
'spoiler',
);
}
public function filters()
{
$newFilters = array('access',);
return array_merge(parent::filters(), $newFilters);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question