/** * Actual run function for all widget classes extending BaseWidget * * @return mixed */ public function widgetRun() { $pages = Page::getDb()->cache(function ($db) { return Page::find()->where(['parent_id' => $this->parent_id])->orderBy([$this->order_by => $this->order])->limit($this->limit)->all(); }, 86400, new TagDependency(['tags' => [ActiveRecordHelper::getObjectTag(Page::className(), $this->parent_id)]])); return $this->render($this->view_file, ['pages' => $pages, 'parent_id' => $this->parent_id, 'more_pages_label' => $this->more_pages_label, 'display_date' => $this->display_date, 'date_format' => $this->date_format]); }