Backend not working

Hi. I appologize for my bad english. I have multi module (frontend, backend). somesite.cz/web - this is a frontend, works fine somesite.cz/web/administrace - this should be a backend, but not working. Im getting this error:

Web\Frontend\Controllers\IndexController handler class cannot be loaded

in services.php I have this router:

$di->set('router', function () {

$router = new \Phalcon\Mvc\Router();
$router->setDefaultModule("frontend");
$router->setDefaultNamespace('Web\Frontend\Controllers');
$router->add("/administrace", array(
            'module' => 'backend'
        ));
        $router->add('/administrace/:controller', array(
            'module' => 'backend',
            'controller' => 1,
            'action' => 'index',
        ));

        $router->add('/administrace/:controller/:action', array(
            'module' => 'backend',
            'controller' => 1,
            'action' => 2,
        ));
        $router->add(
            "/administrace/:controller/:action/:params",
            array(
            'module' => 'backend',
                "controller" => 1,
                "action"     => 2,
                "params"     => 3,
            )
        );
return $router;

});

I dont know what Im doing wrong. Please help me.

edited Feb '15

Did you used phalcon developer tools to generate backend or you did it manually ???

If you want to call index controller then pass it in controller paramenter and pass method name in action parameter. check the module parameter i think it has to be frontend.

``` <?php $router->add( "/administrace/:controller/:action/:params", array( 'module' => 'frontend', "controller" => 'index', "action" => 'methodName', "params" => 'methodParams', ) ); ```

URL which showing an example. http://docs.phalconphp.com/en/latest/reference/routing.html



30.7k

Hi,

did you use phalcon's loader to register your namespaces ?