Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

(not solved) Multiple module routing with "special" directory structure

I have the following directory structure:

/app
    /config
    /controllers
    /models
    /views
/backend
    /app
        /controllers
        /views
    /public
/public

The frontend module's controllers are located at /app/controllers and the views at /app/views. Similar to the backend module, just the app directory is located at /backend/app.

Currently the frontend routing works but there seems problems identifying the backend module when I open example.com/backend. The controller "Controllers\Frontend\BackendController" could not be found.

I would say I have to edit the .htaccess files?

I'm glad if anyone could help me solving this problem.

P.S: Project is available on GitHub (https://github.com/tyurderi/teeworlds-dev)



61.0k
Accepted
answer
edited Oct '15

can you change this https://github.com/tyurderi/teeworlds-dev/blob/master/app/config/router.php#L3 to

$router = new Phalcon\Mvc\Router(false);


2.5k
edited Oct '15

Works. Thank you!

edit: Damn it. Works, but it routes now to frontend instead of backend.



61.0k
edited Oct '15

at what url exacly opens frontend module ?

//edit

add

$router->removeExtraSlashes(true);

just to be sure



2.5k

This seems really to work. Thank you again, Izo. :)



61.0k