Advanced Template Question

I have been working in Yii1.1 for a while and am trying to get to grips with Yii2.0. I need some advice.

The advanced template has common, console, backend, frontend applications. What I want to do is to have common, console, client1, client2, client3, etc applications. We want to develop a code base where re-use of certain functionality will not need to be copied from application to application, it will just sit in the common folder and an update there will immediately benefit all our clients. Please note the client applications will all be very similar, it is not vastly different web applications.

My questions are:

  1. Is this acceptable and what the template was designed for? We have no need for a ‘backend’ per se … control of administrative functionality will be through user access control and be visible on the main client application (which could be shared even, for example, adding of users)

  2. How would I ensure that all the client folders are updated using composer? This is something I know very little about. Beyond using it to download the template in the first place, I know nothing … I have started reading up on it, but there is a gap in my knowledge.


  1. It’s not what template was done for but you may use it like that, I see no big problems doing so.

  2. You can manage it via composer but generally it’s better to stick with just git for your own project main repo.

As per your structure mentioned, you may not need to worry about these folders getting updated - because composer will only update your vendor folder, which is common across the app template.

Can I ask another question about advanced template?

Why fields "created_at" and "updated_at" in table "user" have "integer" type?

Why not timestamp?


Unix timestamp is integer so I’ve used the simplest approach possible. You may use DATETIME or TIMESTAMP if needed.

Yes, but integer is not timezone-aware :) But I understand, it’s not a common issue. Thank you.

I have another question:

Where can I read about tests structure in advanced template?

In Yii 1.x tests were so simple and obvious, but now with Codeception I can’t understand this mess (especially fixtures usage) :)

There will be docs but these aren’t there yet.

I have a question about config managment in advanced template.

Why "common/config/params.php" is included in "backend/config/main.php", but "common/config/main.php" is included in "environments/dev/backend/web/index.php" ?

Why not to include "common/config/params.php" and "common/config/main.php" in "backend/config/main.php"?