Ejemplo n.º 1
0
 public function init()
 {
     parent::init();
     $this->_texts = Data::cache(TextModel::CACHE_KEY, 3600, function () {
         return TextModel::find()->asArray()->all();
     });
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
 public function init()
 {
     parent::init();
     $this->_items = Data::cache(CarouselModel::CACHE_KEY, 3600, function () {
         $items = [];
         foreach (CarouselModel::find()->status(CarouselModel::STATUS_ON)->sort()->all() as $item) {
             $items[] = new CarouselObject($item);
         }
         return $items;
     });
 }
Ejemplo n.º 4
0
 public function init()
 {
     parent::init();
     $data = Data::cache(CarouselModel::CACHE_KEY, 3600, function () {
         return CarouselModel::find()->status(CarouselModel::STATUS_ON)->sort()->asArray()->all();
     });
     foreach ($data as $item) {
         $temp = ['content' => '<img src="' . $item['image'] . '"/>', 'caption' => ''];
         if ($item['title']) {
             $temp['caption'] .= '<h3>' . $item['title'] . '</h3>';
         }
         if ($item['text']) {
             $temp['caption'] .= '<p>' . $item['text'] . '</p>';
         }
         $this->_items[] = $temp;
     }
 }
Ejemplo n.º 5
0
 public function init()
 {
     parent::init();
     $this->_texts = TextModel::find()->asArray()->all();
     /*})*/
 }