How to organize Zend project with separate frontend and backend?

Hey everyone! I’m working on my second Zend project and I’m a bit stuck. I need to set up both a frontend and backend, but I’m not sure how to organize everything.

Can anyone share tips on how to structure the folders for this kind of setup? I’m especially confused about telling Zend which folder is for the frontend and which is for the backend. I only see one setting in the application.ini file (resources.frontController.controllerDirectory) for the controller directory.

I’d really appreciate any advice on best practices for organizing a Zend project with separate frontend and backend components. Thanks in advance for your help!

ooh, interesting project! have u considered using subdomains? like frontend.yoursite.com and backend.yoursite.com? It could help separate things nicely. what about using different layouts for each part? curious to hear ur thoughts on these ideas!

Having worked on several Zend projects with separate frontend and backend, I can share some insights. One effective approach is to create two distinct modules within your Zend application: ‘frontend’ and ‘backend’.

In your application’s directory structure, create separate folders for each module. Place all frontend-related controllers, views, and models in the frontend module, and do the same for the backend.

To configure this, you’ll need to use the module bootstrap feature in Zend. In your application.ini, set resources.frontController.moduleDirectory to point to your modules folder. Then, create module-specific bootstrap files to handle module-specific configurations.

This separation allows for better code organization and makes it easier to maintain and scale your application. It also provides a clear distinction between frontend and backend functionalities, which can be particularly useful when working in teams.

hey sam, i’ve been there! one approach is using modules. create ‘frontend’ and ‘backend’ folders in your app. put controllers, views, etc. for each part in their folder. in application.ini, set resources.frontController.moduleDirectory to your modules folder. helps keep things tidy n easy to manage.