fix

parent 799012a6
......@@ -31,7 +31,7 @@ use common\modules\blog\models\Post;
<?php if($model->preview)
{
echo Html::img(\Yii::$app->params['frontUrl'] . '/uploads/blog/' . $model->preview);
echo Html::img(\Yii::$app->params['frontUrl'] . $model->preview);
} ?>
<?= $form->field($model, 'file')->fileInput() ?>
......
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160210_061532_fix_file_columns extends Migration
{
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
$this->alterColumn('posts', 'preview', Schema::TYPE_STRING.'(100) DEFAULT NULL');
$this->alterColumn('co_content', 'preview', Schema::TYPE_STRING.'(100) DEFAULT NULL');
$this->alterColumn('reviews', 'photo', Schema::TYPE_STRING.'(100) DEFAULT NULL');
}
public function safeDown()
{
$this->alterColumn('posts', 'preview', Schema::TYPE_STRING.'(60) DEFAULT NULL');
$this->alterColumn('co_content', 'preview', Schema::TYPE_STRING.'(50) DEFAULT NULL');
$this->alterColumn('reviews', 'photo', Schema::TYPE_STRING.'(50) DEFAULT NULL');
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment