Which Yii2 project template to choose, basic or advanced?

Author: Rafal Marguzewicz
Categories: Yii2

yii2 basic or advancedBefore 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 basic folders

yii2-app-advanced better choose when:

  1. important is increased security of admin panel
  2. have to separatee frontend and backend. Frontend is on one domain and e.g. hidden backend on subdomain or another domain
  3. helpful is separate settings frontend and backend.

Yii2-advanced folders:
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
choose basic or advanced

  1. Ryadnov says:

    Imho main feature of advanced app is enviroment initialisation script

    1. Rafal Marguzewicz says:

      Yes, but basic don’t need initialization script. What is next advantage of the basic template.

  2. Saquib Rizwan says:

    This is a very nice guide for a basic concept. Good Work.

Your email address will not be published. Required fields are marked *

Name *
Email *

Read previous post:
Installing framework Yii2 basic advanced on Linux

Install framework Yii2 is very simple, if you have correctly install system to management packages PHP - composer.