Вылетает Fatal error</b>: Uncaught Error: Call to a member function getPages() on null in W:\domains\cms.loc\admin\Controller\PageController.php:12
Stack trace:
#0 [internal function]: Admin\Controller\PageController->listing()
#1 W:\domains\cms.loc\engine\Cms.php(47): call_user_func_array(Array, Array)
#2 W:\domains\cms.loc\engine\Bootstrap.php(21): Engine\Cms->run()
#3 W:\domains\cms.loc\admin\index.php(6): require_once('W:\\domains\\cms....')
#4 {main}
thrown in <b>W:\domains\cms.loc\admin\Controller\PageController.php
пробовал переписать, не помогает
<?php
namespace Admin\Controller;
class PageController extends AdminController
{
public function listing()
{
$this->load->model('Page');
***Ошибка тут!*** $this->data['pages'] = $this->model->page->getPages();
$this->view->render('/pages/list', $this->data);
}
public function create()
{
$this->view->render('/pages/create');
}
public function edit($id)
{
$this->load->model('Page');
$this->data['page'] = $this->model->page->getPageData($id);
$this->view->render('pages/edit', $this->data);
}
public function add()
{
$this->load->model('Page');
$params = $this->request->post;
if(isset($params['title'])) {
$pageId = $this->model->page->createPage($params);
echo $pageId;
}
}
public function update()
{
$this->load->model('Page');
$params = $this->request->post;
if(isset($params['title'])) {
$pageId = $this->model->page->updatePage($params);
echo $pageId;
}
}
}
Продвижение своими сайтами как стратегия роста и независимости