Welcome Guest, Not a member yet? Register   Sign In
rails-like before_filter
#3

[eluser]webthink[/eluser]
Perhaps it's because I'm not familiar with rails but what advantage do filters give you over something like the following?
Code:
<?
class Start extends Controller {

    function Start() {
        parent::Controller();
        $this->authorization();
    }
    
    function index(){
        //... the index ...
    }
    
    function authorization(){
        if(user_not_logged()){
            redirect('other_ctrl/login');
        }
    }
        
}

?>


Messages In This Thread
rails-like before_filter - by El Forum - 04-08-2008, 09:49 AM
rails-like before_filter - by El Forum - 04-08-2008, 09:53 AM
rails-like before_filter - by El Forum - 04-08-2008, 11:16 AM
rails-like before_filter - by El Forum - 04-09-2008, 09:52 AM
rails-like before_filter - by El Forum - 07-03-2008, 12:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB