In Indonesia alone, active communities discussing Yii and Yii2 can be found on Facebook. There are some very active groups discussing Yii. Here is a list of Facebook groups that discuss Yii:
- Yii PHP Framework Indonesia with a total membership of 24,265
- PHP Indonesia with the number of 108,401 members only in this group not only Yii discussed.
$ php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.8
$ php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.8
Now please access the URL http://localhost/hello-yii/web/index.php through a web browser and you will see a beautiful page as shown below:
View the Yii2 folder structure
- Assets, contains assets and defines the assets set in the AppAsset.php file
- Commands, contains files that will be executable through the console. You will find a file called HelloController.php when downloading the basic version.
- Config, contains files to manage the web apps you build. Inside the folder there are four main files are console, db, params, and web
- Controllers, contains the controller files you will write to compile the actions that will be accepted by the web app you build.
- Mail, containing a special view file for e-mail
- Models, contains a model file that will define the tables of the database you are using and you can use in the controller you have created to access the database. You can create two types of classes inherited from ActiveRecord or Model.
- Runtime, contains the files that were generated when the Yii2 web application was started.
- Tests, contains files that will run testing for web applications. You can use CodeCeption to test your Yii2 web application
- Vendor, contains the file where the Yii2 library is located. You can also install various PHP libraries via Composer
- Views, contains files for writing views and templates to use in displaying web pages.
- Web, contains index.php files and static assets for Yii2 web pages
Yii Console commands
- Database migration
- Running the default web server Yii2
- Run the command you create through the controller you place in the commands folder
- Manage assets and cache
- Using dummy data with Fixture
- Generate controller code, model, or auto CRUD using Gii