Welcome Guest, Not a member yet? Register   Sign In
Controller Filters - Input needed
#8

(This post was last modified: 07-07-2016, 11:08 PM by orionstar.)

@kilishan You mentioned that there will be an event system... A default beforeController/afterController events are not enough? The controller and actions name can be passed by arguments. After that the user can do whatever wants with the data.

Besides this, I have my own before-after filter implementation in my company's CMS, MY_Controller:
PHP Code:
    public function _remap($method$params = array())
    {
        
$this->_run_before_filters();

        if (
method_exists($this$method))
        {
            empty(
$params) ? $this->{$method}() : call_user_func_array(array($this$method), $params);
        }
        else
        {
            
show_404();
        }

        
$this->_run_after_filters();
    } 

It's not that pretty, but it's only stayed in because of the legacy apps, now I use events...
Reply


Messages In This Thread
Controller Filters - Input needed - by kilishan - 07-07-2016, 08:39 PM
RE: Controller Filters - Input needed - by arma7x - 07-10-2016, 06:46 AM
RE: Controller Filters - Input needed - by arma7x - 07-07-2016, 09:14 PM
RE: Controller Filters - Input needed - by orionstar - 07-07-2016, 10:55 PM
RE: Controller Filters - Input needed - by arma7x - 07-10-2016, 11:42 PM
RE: Controller Filters - Input needed - by arma7x - 07-12-2016, 01:55 AM
RE: Controller Filters - Input needed - by arma7x - 07-13-2016, 12:23 AM
RE: Controller Filters - Input needed - by arma7x - 07-14-2016, 12:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB