예제 #1
0
 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.';
 }
예제 #3
0
파일: Text.php 프로젝트: radiegtya/easyii
 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);
     }
 }
예제 #4
0
파일: Text.php 프로젝트: vitalik74/easyii
 public function init()
 {
     parent::init();
     $this->_texts = TextModel::find()->asArray()->all();
     /*})*/
 }
예제 #5
0
 public function actionIndex()
 {
     $items = Carousel::itemlist(1306, 460);
     $testmonials = Text::find()->all();
     return $this->render('index', array('items' => $items, 'testmonials' => $testmonials));
 }
예제 #6
0
 public function actionIndex()
 {
     $data = new ActiveDataProvider(['query' => Text::find()]);
     return $this->render('index', ['data' => $data]);
 }