2
votes

I'm working with Yii Framework 2. How can I create an app with one backend and two front ends?

For example:

  • Backend for Admins and Moderators (url: admin.example.com)
  • Frontend app for Publishers (url: publisher.example.com)
  • Frontend app for Advertisers (url: advertiser.example.com)

All apps should have a common db, models and 3 different layouts. I found a Yii2 advanced template where are only two: frontend and backend.

1
One of the advanced templates has frontend, admin and API, which is similar you your situation. Look up on github. - crafter

1 Answers

1
votes

You can build as many fronts as you need by adding them as independent modules. Each within a separate folder, with its own configs and own controllers. Then they may all share the same models.

You may check Module docs for more details or you may also check this example which is built for REST on top of a basic template, so you'll need different apache and app configs but it is practically the same.