We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Error in Router\Annotations

setting routes is with an error doubling the namespace

Registering a router

$router = new Router\Annotations( false );
$router->addModuleResource ( 'quest', 'Web\Quest\Controllers\Category' );

show

Class Web\Quest\Controllers\Web\Quest\Controllers\CategoryController does not exist
edited Jul '16

Try adding extra slash before web as it will tell phalcon not to append any route but consider this root.

$router->addModuleResource ( "quest", "\Web\Quest\Controllers\Category" );
Class \Web\Quest\Controllers\\Web\Quest\Controllers\CategoryController does not exist

On win both type of slashes work but on linux only forward slash work, so could you please try it with forward slash.

$router->addModuleResource ( "quest", "/Web/Quest/Controllers/Category" );

otherwise, you can also use only controller name like:

$router->addModuleResource ( "quest", "Category" );

must be an error in Phalcon 2.1.0 in Windows, both quotes duplicate namespace, and no namespace it goes to the frontend module

$router->addModuleResource ( "quest", "Category" );

Class Web\Frontend\Controllers\CategoryController does not exist

end

$router->addModuleResource ( "quest", "/Web/Quest/Controllers/Category" );

Class \Web\Quest\Controllers\/Web/Quest/Controllers/CategoryController does not exist

end

$router->addModuleResource ( "quest", "Web/Quest/Controllers/Category" );

Class \Web\Quest\Controllers\Web/Quest/Controllers/CategoryController does not exist