How to structure this Symfony web project?
- by James William
I am new to Symfony and am not sure how to best structure my web project. The solution must accommodate 3 use cases:
Public access to www.mydomain.com for general use
Member only access to member.mydomain.com
Administrator access to admin.mydomain.com
All three virtual hosts point to the Symfony /web directory
Questions:
Is this 3 separate applications in my Symfony project (e.g. "frontend", "backend" and "admin" or "public", "member", "admin")?
Is this a good approach if there is to be some duplicate code (e.g. generating a member list would be common across all 3 applications, but presented differently)?
How would I route to the various applications based on the subdomain when a user accesses *.mydomain.com? Where in Symfony should this routing logic be placed?
Or, is this one application with modules for each of the above use cases?
EDIT: I do not have access to httpd.conf in apache to specify a default page for virtual hosts. I can only specify a directory for each subdomain using the hostin provider's cPanel.