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

Asset Manager in modules

Hi,

I have a question for the Asset Manager: I would like the resources (JS, CSS, etc.) take a modular basis. How and where can I notify the asset manager that the resources should be loaded from the respective module? And what is about the routing? => e.g. app / modules / module / assets / css / styles.css

Greetings Mario



98.9k

Hi, you can define the "assets" service in the module definition isolating the assets by module:

https://docs.phalcon.io/en/latest/reference/applications.html#multi-module https://github.com/phalcon/mvc/blob/master/multiple/apps/backend/Module.php#L25

You can set a different base uri for static resources per module: https://docs.phalcon.io/en/latest/reference/url.html#static-vs-dynamic-uris