Which Yii2 project template to choose, basic or advanced?
Author: Rafal MarguzewiczPublished:
Categories: Yii2
Tags:
Before installation framework Yii2 we have to choose two version: Yii2 Basic Project Template and Yi2 Advanced Project Template
Looking at the functionality of both version can have the same functions. Even if the basic version does not have some functionality, can be added.
The main different of these versions is that the Yii2-app-advanced contain 2 separated application (folder frontend
and backend
) with shared code (folder common
and vendor
).
Yii2 Basic include folders model, view and config in common namespace “app”
Yii2 Advanced have 4 namespace: frontend, backend, common, console.
The Yii2 Basic Project Template is a great starting point for all Yii2 applications, except those very few that actually need two separate applications (frontend/backend).
Yii2-basic folders:
yii2-app-advanced better choose when:
- important is increased security of admin panel
- have to separatee frontend and backend. Frontend is on one domain and e.g. hidden backend on subdomain or another domain
- helpful is separate settings frontend and backend.
Yii2-advanced folders:
Choose version has a major impact of development. For this version Yii2-basic-template is simpler, development is faster. In some cases when we have a really good backend, work with Yii2 advanced application template may be faster.
Configuration of HTTP server
Yii2 Advanced need more work with configuration HTTP Server (NGINX, Apache). Especially if frontend is on main domain and backend is on subfolder. Configuration of server HTTP for Yii2 Basic is very faster and simple.
Manager URL
Yii2 advanced have 2 separated manager URL. To apply linking the backend to the frontend must have additional knowledge.
In case basic version, you can use knowledge base configuration manager URL
At the end of the table a comparison from this page
Imho main feature of advanced app is enviroment initialisation script
Yes, but basic don’t need initialization script. What is next advantage of the basic template.
This is a very nice guide for a basic concept. Good Work.