Welcome Guest, Not a member yet? Register   Sign In
Extension of Filters config
#1

Hi,

I'm readng the docs and trying to use filters. Noticed, that we can configure filters in Filters and Routes configs.

https://codeigniter.com/user_guide/incom...ml#filters

We can only set uri pattern for filter, but can't set params for filters. Although, Routes config allows it.

https://codeigniter.com/user_guide/incom...ng-filters

I think its's good that we can configure filter in routes, but it's some strange, that Routes config give us more availabels for setting filters than Filters config.

May will be expand Filters config something like this?
PHP Code:
public $filters = [
    'role' => [
        'before' => [
            'uri' => ['account/*'],
            'params' => [
 
                1,
 
                2,
                'type' => 'strong',
                'ids' => [12],
            ]
        ]
    ],
]; 

That wiil allow to configure not only uri patterns, but any params, which need for custom filters.
Or like this (with "except uri" pattern):
PHP Code:
public $filters = [
    'role' => [
        'before' => [
            'uri' => ['account/*'],
            'except' => ['account/login'],
            'params' => [...]
        ]
    ],
]; 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB