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.

Multi module application in 3.x

I've got multi module app. In main index.php, i set route from my ini file:

pattern         = '/'
module          = front
controller      = index

pattern         = '/{module:moderator|admin}(.*)'
module          = 1

Next is registring modules, where each module have own Module.php where I've got reading of ini file with routing definitions for module. In phalcon 1.x and 2.x that solution worked, but in 3.x not.

Have you got some idea how make multi module app in 3.x with structure like? :


Thanks :)

I have multi module application in 3.0.x. No problems here. What's your problem ?

@Wojciech - have you got routing in one file or load sepearate routing file for each module?

Seperate routing per each module. But im using routing class. How exactly you are loading this routes ?

edited Oct '16

Well, problem solved. It was problem with \Phalcon\Config\Adapter\Ini. I'm loading my ini files with that class and in 3.x pattern need be defined without apostrophes. So for 1.x and 2.x we have:

pattern  = '/{module:moderator|admin}'

and for 3.x:

pattern  = /{module:moderator|admin}