コード例 #1
0
ファイル: MainTheme.php プロジェクト: BoBRoID/new.k-z
 public function beforeSave($insert)
 {
     if ($this->order == null) {
         $this->order = MainTheme::find()->select("MAX(`order`)")->scalar() + 1;
     }
     return parent::beforeSave($insert);
     // TODO: Change the autogenerated stub
 }
コード例 #2
0
ファイル: DefaultController.php プロジェクト: BoBRoID/new.k-z
 /**
  * Renders the index view for the module
  * @return string
  */
 public function actionIndex()
 {
     return $this->render('index', ['themes' => new ActiveDataProvider(['query' => MainTheme::find(), 'sort' => ['defaultOrder' => ['order' => SORT_ASC]]])]);
 }
コード例 #3
0
ファイル: MainTheme.php プロジェクト: BoBRoID/new.k-z
 public static function find()
 {
     return parent::find()->where(['enabled' => 1]);
 }