Welcome Guest, Not a member yet? Register   Sign In
Filters except parameter (not for globals only)
#1

Hello guys, 
I would like to request to add "except" parameters for Filters. We currently have this option to not apply filters for specific paths only for global filters. However, this feature is very useful for modules. When you define routes with group segment and you want to apply a filter to all groups except one or two paths without touching the main filters config.

Scenario:
Imagine you have a main front end that does not use authentication, then you add a code module that has authentication of it its own. So you want to restrict all paths to the code module except login.
So this would be a handy feature like for the globals:
PHP Code:
<?php

namespace Config;

use 
CodeIgniter\Config\BaseConfig;

class 
Filters extends BaseConfig
{
    public $globals = [
        'before' => [
            'csrf' => ['except' => ['foo/*''bar/*']],
        ],
        'after' => [],
    ];

    // ...


Thanks
Reply




Theme © iAndrew 2016 - Forum software by © MyBB