Welcome Guest, Not a member yet? Register   Sign In
action with the same name as the controller
#1

[eluser]tomas[/eluser]
If I create a new controller, let's say Test and then add index and test actions,
going to index.php/test/test executes the index action instead of the test action

Code:
class Test extends CI_Controller {

    public function __construct(){
        parent::__construct();
    }
    public function index(){
        echo 'here';
    }
    
    public function test(){
        echo 'there';
    }
}

navigating to
Code:
index.php/test/test
outputs 'here' instead of 'there'


Messages In This Thread
action with the same name as the controller - by El Forum - 07-19-2011, 03:44 AM
action with the same name as the controller - by El Forum - 07-19-2011, 04:14 AM
action with the same name as the controller - by El Forum - 07-19-2011, 10:34 AM
action with the same name as the controller - by El Forum - 07-19-2011, 01:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB