This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function safeUp() | |
{ | |
$tableOptions = null; | |
if ($this->db->driverName === 'mysql') { | |
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; | |
} | |
$this->createTable('{{%article_category}}', [ | |
'id' => $this->primaryKey(), | |
'slug' => $this->string(1024)->notNull(), | |
'title' => $this->string(512)->notNull(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function up() | |
{ | |
$tableOptions = null; | |
if ($this->db->driverName === 'mysql') { | |
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; | |
} | |
$this->createTable('{{%page}}', [ | |
'id' => $this->primaryKey(), | |
'slug' => $this->string(2048)->notNull(), | |
'title' => $this->string(512)->notNull(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function registerClientScript() | |
{ | |
UploadAsset::register($this->getView()); | |
$options = Json::encode($this->clientOptions); | |
if ($this->sortable) { | |
JuiAsset::register($this->getView()); | |
} | |
$this->getView()->registerJs("jQuery('#{$this->getId()}').yiiUploadKit({$options});"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function loadModel($id, $class = false, $attributes = false, $prepare = true, $seo = true, $condition = '', $params = array()) | |
{ | |
if ($class === false) { | |
$class = $this->getModelClass(); | |
} | |
/** @var ActiveRecord $finder */ | |
$finder = ActiveRecord::model($class)->published(); | |
if (is_array($id) && $attributes) { | |
$model = $finder->findByAttributes($id, $condition, $params); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$form = ActiveForm::begin( | |
[ | |
'id' => '', | |
'fieldClass'=>ClearActiveField::className()] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rm -r --cached . | |
git add * | |
git commit -m "add .gitignore" |