PHP code example of bigdropinc / yii2-sti
1. Go to this page and download the library: Download bigdropinc/yii2-sti library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bigdropinc / yii2-sti example snippets
php composer.phar
public function safeUp()
{
$this->addColumn(User::tableName(), 'type', $this->string(20));
$this->createIndex('idx-users-type', User::tableName(), 'type');
}
public function safeDown()
{
$this->dropColumn(User::tableName(), 'role');
}
namespace common\models;
class ActiveRecord extends \bigdropinc\sti\ActiveRecord
{
}