Gii code generator
This extension provides a web-based code generator called Gii for Yii 2 applications. You can use Gii to quickly generate models, forms, modules, CRUD, and many more.
Getting ready
- Create a new application by using composer, as described in the official guide at http://www.yiiframework.com/doc-2.0/guide-start-installation.html.
- Create a new migration with the shell command:
php yii migrate/create create_customer_table
- Put the following code into the
up()
anddown()
methods:use yii\db\Schema; use yii\db\Migration; class m160201_154207_create_customer_table extends Migration { public function up() { $tableOptions = null; if ($this->db->driverName === 'mysql') { $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; ...
Get Yii2 Application Development Cookbook - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.