Skip to content
Yii2 Project Template
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets code upgrade up to PHP 5.6 Feb 19, 2018
config simplify `install.php` calls, improve views navigation Mar 2, 2018
controllers code upgrade up to PHP 5.6 Feb 19, 2018
mail code upgrade up to PHP 5.6 Feb 19, 2018
messages Initial commit Feb 24, 2016
migrations code upgrade up to PHP 5.6 Feb 19, 2018
models code upgrade up to PHP 5.6 Feb 19, 2018
runtime Initial commit Feb 24, 2016
tests code upgrade up to PHP 5.6 Feb 19, 2018
validators code upgrade up to PHP 5.6 Feb 19, 2018
views simplify `install.php` calls, improve views navigation Mar 2, 2018
web backend CSS adjustment Apr 20, 2017
webstub Initial commit Feb 24, 2016
widgets 'frontend' alert display provided May 26, 2016
.gitattributes Initial commit Feb 24, 2016
.gitignore Codeception Tests Refactoring (#1) Jan 12, 2017
.travis.yml
LICENSE.md travis added Jun 30, 2016
README.md Logo added to README.md Jul 27, 2017
codeception.yml Codeception Tests Refactoring (#1) Jan 12, 2017
composer.json remove path specification for 'cap' Mar 2, 2018
install.php simplify `install.php` calls, improve views navigation Mar 2, 2018
phpunit.xml.dist imagick install added to Travis Feb 19, 2018
requirements.php code upgrade up to PHP 5.6 Feb 19, 2018
yii Initial commit Feb 24, 2016
yii.bat Initial commit Feb 24, 2016

README.md

Yii 2 Project Template


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

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

The template is designed to work in a team development environment.

Latest Stable Version Total Downloads Build Status

REQUIREMENTS

Requirements check script:

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:

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

ASSET COMPRESSION

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

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.

The 'backend' assets compression is performed as separated command:

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.

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:

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.

In order to perform an update, run the following commands:

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

GII

Admin section generation:

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:

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:

php yii message messages/config.php

TESTING

This project supports testing via PHPUnit as well as via Codeception

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.

Please refer to Codeception Testing manual for the details about Codeception tests setup and running.

You can’t perform that action at this time.