Welcome Guest, Not a member yet? Register   Sign In
Get controller's method variables in Filter's before method
#1

(This post was last modified: 07-30-2020, 04:50 AM by yassine.)

Hi,

I know it is possible to get the variables in the controller's _remap() method though I'd like to have a filter handling a logic at a higher level (if possible).

Here's an example of my code:
PHP Code:
        $routes->get('users/(:num)''User::view/$1', [
            'as' => 'user',
            'filter' => 'permission:user-view',
        ]); 

Is there a way to get the userId I'm passing in the route inside the before method of the permission filter?

Thanks for any help!
Reply


Messages In This Thread
Get controller's method variables in Filter's before method - by yassine - 07-30-2020, 04:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB