Help me find a mistake, I have already rechecked everything 20 times.
Produces Parse error: syntax error, unexpected '?' in D: \ wordpress \ openserver \ OpenServer \ domains \ php-framework-master \ application \ models \ Main.php on line 35
Here is the code from lines 31-35
public function postsList($route) { $max = 10; $params = [ 'max' => $max, 'start' => ((($route['page'] ?? 1) - 1) * $max), ]; return $this->db->row('SELECT * FROM posts ORDER BY id DESC LIMIT :start, :max', $params); } after it came out Notice points to the line
'list' => $this->model->postsList($this->route['page']), all code
public function indexAction() { $pagination = new Pagination($this->route, $this->model->postsCount()); $vars = [ 'pagination' => $pagination->get(), 'list' => $this->model->postsList($this->route['page']), ]; $this->view->render('Главная страница', $vars); }