Yii2 application template
The skeleton of Yii 2 application best for rapidly creating your projects.
The template contains the basic features including user login/logout and a contact page. It includes all commonly used configurations that would allow you to focus on adding new features to your application.
assetsthe source scripts, styles and etc.
configthe application configurations
messagesthe I18n translations
migrationsthe database migrations (namespace
modulesthe application modules (namespace
publicthe front-end entry script and assets
backendthe backend-end entry script and assets
runtimethe cache and logs
srcthe PHP sources (classes, interfaces and traits in namespace
commandsthe CLI controllers (running by
controllersthe Web controllers
teststhe unit tests
vendorthe required 3rd-party packages
mailsthe e-mail views
layoutsthe page layouts
The minimum requirement by this project template that your server supports PHP 7.4.
If you do not have Composer, you may install it by following the instructions at getcomposer.org.
You can then install this project template using the following command:
composer create-project --prefer-dist ensostudio/yii2-app your-app
Now you should be able to access the application through the following URL, assuming
your-app is the directory
directly under the Web root.
Edit the file
config/db.php with real data.
- Yii won't create the database for you, this has to be done manually before you can access it.
- Check and edit the other files in the
configdirectory to customize your application as required.
Tests are located in
tests directory. They are developed with PHPUnit.
Edit the file
tests/bootstrap.php to configure your test application.
Tests can be executed by running
composer run tests