Пример #1
0
 public function posts()
 {
     $posts = Model::getAll('Blog\\Model\\Post');
     foreach ($posts as $post) {
         $post->author = Model::get('Blog\\Model\\User', $post->user_id)->name;
     }
     $this->render('Post/list', ['posts' => $posts]);
 }
Пример #2
0
 public function index()
 {
     return $this->render([$this->list => Model::getAll($this->model)]);
 }
Пример #3
0
 public function index()
 {
     return $this->render(['categories' => Model::getAll('Blog\\Model\\Category')]);
 }
Пример #4
0
 public function index()
 {
     $this->render('User/index', ['users' => Model::getAll('Blog\\Model\\User')]);
 }