0
0

Помогите пожалуйста ! Выходит ошибка!

An uncaught Exception was encountered
Type: ParseError

Message: syntax error, unexpected '(', expecting variable (T_VARIABLE)

Filename: C:\xampp\htdocs\kinomonster\application\controllers\News.php

Line Number: 7

Backtrace:

File: C:\xampp\htdocs\kinomonster\index.php
Line: 315
Function: require_once

Вот мой код

<?php

defined('BASEPATH') OR exit('No direc script access allowed');


class News extends CI_Controller {
public function__construct() {
parent::__construct();
}

public function index() {
$data['title'] = "Все новости";

$this->load->view('templates/header', $data);
$this->load->view('news/index', $data);
$this->load->view('templates/footer');
}
}




Алексей Камардин
3 years ago






Что делать?

Алексей Камардин
3 years ago

<?php 

defined('BASEPATH') OR exit('No direct script access allowed');

class News extends MY_Controller {

	public function __construct() {
		parent::__construct();
		$this->load->model('news_model');
	}

	public function index() {
		$this->data['title'] = "Все новости";
		$this->data['news'] = $this->news_model->getNews();

		$this->load->view('templates/header', $this->data);
		$this->load->view('news/index', $this->data);
		$this->load->view('templates/footer');

	}
Пётр Колосов
1 year ago

2 ответов