Welcome Guest, Not a member yet? Register   Sign In
Is there a way to route an entire controller?
#1

Is there a way to route an entire controller, so I can route a controller to be / (root directory)?

Let's say my controller looks like this.



Code:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Main extends MY_Controller {

    public function debate($nodeviewid){

    }

    public function question($nodeviewid){

   }
}


By doing this (setting a route for my controller), all actions in my specific controller I set the controller's route in, (such as "debate") inherit this route so action debate has the /debate url and action question has the /question url.

It would be more convenient to map or route an entire controller and all actions in that controller by default become a subroute of it, than setting each route for each of my controller actions individually.
Reply


Messages In This Thread
Is there a way to route an entire controller? - by desbest - 08-01-2017, 10:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB