Welcome Guest, Not a member yet? Register   Sign In
How do I make the route for methods in a controller all stem from the root?
#1

(This post was last modified: 07-10-2017, 12:56 PM by desbest.)

How do I make the route for methods in a controller all stem from the root?


So If I have


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

class Main extends MY_Controller {

public function debates(){
}

public function questions(){

}

public function index()
{
}

/main/debates routes to /debates and /main, /main/questions routes to /questions automatically based on the method name.

According to the documentation I can define a route then define what I want it to be rewritten to, but when I do that, it doesn't work.

PuttingĀ $route['main/debates'] = 'debates'; orĀ $route['main/questions'] = 'questions'; causes an error 404.
Reply


Messages In This Thread
How do I make the route for methods in a controller all stem from the root? - by desbest - 07-10-2017, 12:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB