コード例 #1
0
 protected function doExecute()
 {
     $view = new AuthorsHtmlView($this->data);
     $model = new AuthorsModel();
     $model['blog.id'] = $this->data['blog']->id;
     $model['list.start'] = $this->input->getInt('start');
     $model['list.limit'] = 10;
     $model['list.search'] = $this->input->getString('q');
     $view->set('items', $model->getItems());
     return $view->render();
 }
コード例 #2
0
 /**
  * prepareOptions
  *
  * @return  array|\Windwalker\Html\Option[]
  */
 protected function prepareOptions()
 {
     $options = array();
     $model = new AuthorsModel();
     $model['blog.id'] = $this->blog;
     $authors = $model->getItems();
     foreach ($authors as $author) {
         $options[] = new Option($author->name ?: $author->user_fullname, $author->id);
     }
     return $options;
 }