Welcome Guest, Not a member yet? Register   Sign In
routing and controllers
#5

[eluser]deineMudder[/eluser]
[quote author="marcoss" date="1182687926"][quote author="deineMudder" date="1182687356"]
as i said i just tried it with www.mydomain.com/admin/user

to get to the user controller.
i have no routing set up yet.[/quote]

In that case, the user controller (inside admin dir) should have an index() function to handle the default requests.

If you want to trigger an specific function by default, lets say manage users, you can do that this way.

Quote:class User extends Controller {

function User(){
parent::Controller();
}

function index(){
$this->manage()
}

function manage(
/*
manage code here
*/
)

function add(){}
function edit(){}
function delete(){}

}
[/quote]

/admin/user leads to a 404 instead to the proper controller
in controllers/admin/user.php -> index()


Messages In This Thread
routing and controllers - by El Forum - 06-24-2007, 12:50 AM
routing and controllers - by El Forum - 06-24-2007, 01:05 AM
routing and controllers - by El Forum - 06-24-2007, 01:15 AM
routing and controllers - by El Forum - 06-24-2007, 01:25 AM
routing and controllers - by El Forum - 06-24-2007, 01:29 AM
routing and controllers - by El Forum - 06-24-2007, 01:50 AM
routing and controllers - by El Forum - 06-24-2007, 02:32 AM
routing and controllers - by El Forum - 06-24-2007, 02:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB