2017 © Pedro Peláez
 

project project-template

Yii 2 Project Template from yii2tech

image

yii2tech/project-template

Yii 2 Project Template from yii2tech

  • Saturday, March 3, 2018
  • by klimov-paul
  • Repository
  • 12 Watchers
  • 49 Stars
  • 55 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 4 Versions
  • 22 % Grown

The README.md

, (*1)

Yii 2 Project Template


This project is a skeleton Yii 2 application best for developing complex Web applications with multiple tiers., (*2)

The template includes three tiers: front end, back end, and console, each of which is a separate Yii application., (*3)

The template is designed to work in a team development environment., (*4)

Latest Stable Version Total Downloads Build Status, (*5)

REQUIREMENTS

Requirements check script:, (*6)

php requirements.php

INSTALLATION

  1. Clone the repository into the project destination directory.
  2. Switch the project branch to the needed one: 'master', 'stage', 'live' etc.
  3. Run the installation script using following command:
php install.php init/all

Project should be deployed beyond web accessible folder. Actual web root should be created as symlink to the 'web' folder:, (*7)

ln -s /path/to/project/web /var/www/html/project

ASSET COMPRESSION

For assets (CSS and JavaScript) compression use following command:, (*8)

cd /path/to/project/root
php yii asset config/frontend-asset-compress.php config/frontend-assets.php

See config/frontend-asset-compress.php file for more details., (*9)

The 'backend' assets compression is performed as separated command:, (*10)

cd /path/to/project/root
php yii asset config/backend-asset-compress.php config/backend-assets.php

See config/backend-asset-compress.php file for more details., (*11)

SITEMAP GENERATION

Sitemap is generated by app\controllers\console\SitemapController::actionGenerate() method. Make sure all pages, which should appear at sitemap are processed in this method. For sitemap generation use following command:, (*12)

cd /path/to/project/root
php yii sitemap/generate

SELF-UPDATE

After successful installation 'stage' or 'production' server can be updated using 'self-update' command., (*13)

In order to perform an update, run the following commands:, (*14)

cd /path/to/project/root
php yii self-update config/self-update.php

GII

Admin section generation:, (*15)

php yii gii/adminCrud --modelClass="app\models\db\{NAME}" --controllerClass="app\controllers\backend\{NAME}Controller" --searchModelClass="app\models\backend\{NAME}Search" --viewPath="@app/views/backend/{NAME}" --enableI18N=1

Admin section with context generation:, (*16)

php yii gii/adminCrud --modelClass="app\models\db\{NAME}" --controllerClass="app\controllers\backend\{NAME}Controller" --searchModelClass="app\models\backend\{NAME}Search" --viewPath="@app/views/backend/{NAME}" --contextClass="app\models\db\{CONTEXT}" --enableI18N=1

I18N

Translation messages generation:, (*17)

php yii message messages/config.php

TESTING

This project supports testing via PHPUnit as well as via Codeception, (*18)

Regular PHPUnit tests are located under 'tests\unit' directory. In case you have PHPUnit installed you can run them using phpunit command from the project root., (*19)

Please refer to Codeception Testing manual for the details about Codeception tests setup and running., (*20)

The Versions