Slider.php 1.08 KB
<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "w_slider".
 *
 * @property integer $id
 * @property string $name
 * @property string $img
 * @property string $url
 * @property integer $is_active
 * @property integer $sort
 */
class Slider extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'w_slider';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name', 'img', 'url', 'sort'], 'required'],
            [['is_active', 'sort'], 'integer'],
            [['name'], 'string', 'max' => 100],
            [['img', 'url'], 'string', 'max' => 254]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Название',
            'img' => 'Изображение',
            'url' => 'Адрес перехода',
            'is_active' => 'Выводить',
            'sort' => 'Сортировка',
        ];
    }
}