Welcome Guest, Not a member yet? Register   Sign In
CI beginner question: Dispatcher?
#1

[eluser]Unknown[/eluser]
Hi,

Looking to use CI in next project.

Question
-------------
I want all ajax/post requests to go through a "dispatcher" controller and then call another controller to do the work.

eg.

POST->{dispatcher_controller}->target_controller->return output

I have tried to keep my post short, but if you need more info let me know.

Cheers,
Trav.
#2

[eluser]WanWizard[/eluser]
Have a look at Modular CI (see the wiki), it allows you create controllers calling other controllers...
#3

[eluser]wiredesignz[/eluser]
Try Modular Extensions - PHP5, see my signature.
#4

[eluser]Unknown[/eluser]
Thanks guys, i have got HMVC going. Im still have some learning to do, but i was wondering how i would use HMVC + ci so that ALL requests go through the dispatcher triad and then call the requested triad?

eg:

function dispatcher($request,$action)

// do some global app validation here

switch (request) {
case 'admin':
$func = $action; // any function within the admin controller
// how to call $func in the admin controller (triad)
}

}

}
#5

[eluser]gyo[/eluser]
You might be interested in Routing. Wink




Theme © iAndrew 2016 - Forum software by © MyBB