public function autoRoute($stop = false)
	{
        if ($stop)
        {
            return $this;
        }

		$app = self::getInstance();

        $app->get('(/)', 'IndexController:index');

		$app->get('/:action', function($action = 'index') use ($app) {

			if ( !class_exists('IndexController') )
			{
				$app->notFound();
				return ;
			}

            $this->controllerName = 'index';
            $this->actionName     = $action;

			$controller = new \IndexController;

			if ( !method_exists($controller, $action) )
			{
				$app->notFound();
				return ;
			}

			$controller->$action();
		});

		$app->get('/:controller/:action', function($controller = 'index', $action = 'index') use ($app) {

            $this->controllerName = $controller;
            $this->actionName     = $action;

			$controller  = ucwords($controller) . 'Controller';

			if ( !class_exists($controller) )
			{
				$app->notFound();
				return ;
			}

			$controller = new $controller();

			if ( !method_exists($controller, $action) )
			{
				$app->notFound();
				return ;
			}

			$controller->$action();
		});

		$app->get('/:module/:controller/:action', function($module, $controller = 'index', $action = 'index') use ($app) {
            $this->moduleName     = $module;
            $this->controllerName = $controller;
            $this->actionName     = $action;

			$controller = ucwords($module) . '\Controllers\\' . ucwords($controller) . 'Controller';

			if ( !class_exists($controller) )
			{
				$app->notFound();
				return ;
			}

			$controller = new $controller();

			if ( !method_exists($controller, $action) )
			{
				$app->notFound();
				return ;
			}

			$controller->$action();
		});
	}
public function autoRoute($stop = false)
	{
        if ($stop)
        {
            return $this;
        }

		$app = self::getInstance();

        $app->get('(/)', 'IndexController:index');

		$app->get('/:action', function($action = 'index') use ($app) {

			if ( !class_exists('IndexController') )
			{
				$app->notFound();
				return ;
			}

            $this->controllerName = 'index';
            $this->actionName     = $action;

			$controller = new \IndexController;

			if ( !method_exists($controller, $action) )
			{
				$app->notFound();
				return ;
			}

			$controller->$action();
		});

		$app->get('/:controller/:action', function($controller = 'index', $action = 'index') use ($app) {

            $this->controllerName = $controller;
            $this->actionName     = $action;

			$controller  = ucwords($controller) . 'Controller';

			if ( !class_exists($controller) )
			{
				$app->notFound();
				return ;
			}

			$controller = new $controller();

			if ( !method_exists($controller, $action) )
			{
				$app->notFound();
				return ;
			}

			$controller->$action();
		});

		$app->get('/:module/:controller/:action', function($module, $controller = 'index', $action = 'index') use ($app) {
            $this->moduleName     = $module;
            $this->controllerName = $controller;
            $this->actionName     = $action;

			$controller = ucwords($module) . '\Controllers\\' . ucwords($controller) . 'Controller';

			if ( !class_exists($controller) )
			{
				$app->notFound();
				return ;
			}

			$controller = new $controller();

			if ( !method_exists($controller, $action) )
			{
				$app->notFound();
				return ;
			}

			$controller->$action();
		});
	}
public function autoRoute ( $ stop = false ) { if ( $ stop ) { return $ this ; } $ app = self :: getInstance ( ) ; $ app -> get ( '(/)' , 'IndexController:index' ) ; $ app -> get ( '/:action' , function ( $ action = 'index' ) use ( $ app ) { if ( ! class_exists ( 'IndexController' ) ) { $ app -> notFound ( ) ; return ; } $ this -> controllerName = 'index' ; $ this -> actionName = $ action ; $ controller = new \ IndexController ; if ( ! method_exists ( $ controller , $ action ) ) { $ app -> notFound ( ) ; return ; } $ controller -> $ action ( ) ; } ) ; $ app -> get ( '/:controller/:action' , function ( $ controller = 'index' , $ action = 'index' ) use ( $ app ) { $ this -> controllerName = $ controller ; $ this -> actionName = $ action ; $ controller = ucwords ( $ controller ) . 'Controller' ; if ( ! class_exists ( $ controller ) ) { $ app -> notFound ( ) ; return ; } $ controller = new $ controller ( ) ; if ( ! method_exists ( $ controller , $ action ) ) { $ app -> notFound ( ) ; return ; } $ controller -> $ action ( ) ; } ) ; $ app -> get ( '/:module/:controller/:action' , function ( $ module , $ controller = 'index' , $ action = 'index' ) use ( $ app ) { $ this -> moduleName = $ module ; $ this -> controllerName = $ controller ; $ this -> actionName = $ action ; $ controller = ucwords ( $ module ) . '\Controllers\\' . ucwords ( $ controller ) . 'Controller' ; if ( ! class_exists ( $ controller ) ) { $ app -> notFound ( ) ; return ; } $ controller = new $ controller ( ) ; if ( ! method_exists ( $ controller , $ action ) ) { $ app -> notFound ( ) ; return ; } $ controller -> $ action ( ) ; } ) ; }
Auto router method

@param bool $stop false
@return void
Auto router method