public function init() { parent::init(); $this->_texts = Data::cache(TextModel::CACHE_KEY, 3600, function () { return TextModel::find()->asArray()->all(); }); }
public function insertTexts() { if (Text::find()->count()) { return '`<b>' . Text::tableName() . '</b>` table is not empty, skipping...'; } $this->db->createCommand('TRUNCATE TABLE `' . Text::tableName() . '`')->query(); (new Text(['text' => 'Welcome on EasyiiCMS demo website', 'slug' => 'index-welcome-title']))->save(); return 'Text data inserted.'; }
public function init() { parent::init(); $texts = Data::cache(TextModel::CACHE_KEY, 3600, function () { return TextModel::find()->asArray()->all(); }); foreach ($texts as $text) { $this->_texts[$text['text_id']] = $this->parseText($text); } }
public function init() { parent::init(); $this->_texts = TextModel::find()->asArray()->all(); /*})*/ }
public function actionIndex() { $items = Carousel::itemlist(1306, 460); $testmonials = Text::find()->all(); return $this->render('index', array('items' => $items, 'testmonials' => $testmonials)); }
public function actionIndex() { $data = new ActiveDataProvider(['query' => Text::find()]); return $this->render('index', ['data' => $data]); }