Skip to content

Commit

Permalink
support Router
Browse files Browse the repository at this point in the history
  • Loading branch information
iannsp committed Apr 10, 2012
1 parent ec018d3 commit fc2c016
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ApplicationController.php
Expand Up @@ -31,9 +31,17 @@ public function __construct(Request $R){
* @return void
*/
public function dispatch(){
if ( $this->hasController($this->controller)){
if (!is_null(APP_ROUTE_FILE) and is_file(APP_ROUTE_FILE)) {
$routes = parse_ini_file(APP_ROUTE_FILE);
if ($routes !== false) {
$router = new Router($routes, $this->getRequest());
$router->resolve(LANGUAGE);
}
}
if ( $this->hasController($this->getRequest()->getQuery(0))){
try{
$controllername = "\\Application\\Controller\\".$this->controller;
$controller = $this->getRequest()->getQuery(0);
$controllername = "\\Application\\Controller\\".$controller;//>controller;
$controller = new $controllername($this->getRequest());
$controllermethod = $controller->getRequest()->getQuery(1);
if( method_exists($controller, $controllermethod)) {
Expand Down

0 comments on commit fc2c016

Please sign in to comment.