Hello everybody! My question is, where to find any documentation about the "beforeFiler()" method to use in the constructor of the controller. Which options does it except? I am trying to get work this method like in this example
$this->beforeFilter('admin_check', array('only' => 'getIndex|getString|postString|postTvLang|deleteTvLang|postRadio'));
but it seems to be wrong, so it doesnt work.
Does anybody know whats wrong here?
Tankhs
Best regards
Alex
Not sure, but can you really separate a list of methods with a pipe like this? I know that you can do this with a list of filters when creating a route, but did you try to put your methods in an array like so?
$this->beforeFilter('admin_check', array('only' =>
array('getIndex', 'getString', 'postString'...)));
Your best bet are the API docs. Looking at the docs you can see that the beforeFilter call is instantiating a Before object. Following the rabbit trail all the way down you can see that the before object does indeed accept an array of items for only and except as DavidDomain suggests (look at the definition of the only var).
Thank you darryl, your answer is much more helpful than my suggestion. ;-)
Tanks guys. Nice, API docs is what I indeed need. Your answers are very helpful.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community