We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Sub module routing


I'm trying to convert my current working model to phalcon

I had lots of controllers in my modules also some of my controllers are overcrowded.

so I want to group some of my controllers under same module (I'm avere of sub controller concept I'm looking for a bit more)

What I'm looking for is,

app/domain/admin/modules/mod1/controller app/domain/admin/modules/mod1/model app/domain/admin/modules/mod1/view

app/domain/admin/modules/mod2/controller app/domain/admin/modules/mod2/model app/domain/admin/modules/mod2/view

app/domain/site/modules/mod1/controller app/domain/site/modules/mod1/model app/domain/site/modules/mod1/view


Plus I do not want to write maintain large route files.

If it was possible with current implementation could you give me some examples please.

My best regards...

I assume you are posting folder structure what are the routes you want?


I just looking for way to automated multi module routing.

For example. I had /members for logged users.

However things gonna fast now I had more than 40 controllers under it. And some of those controllers may have more than 12 actions.

So ?

I want to move them into member.mydomain.com

So my old /members module becomes /member subdomain. Still under same app dir organization.

Then I rewrite my old members controllers as modules, and my current actions becomes controllers.

In start ıt looks overkill and after some time it becomes much better than old crowded model.

I just want to do this in automated way. After some thime my routing gets bigger and bigger.