[eluser]Unknown[/eluser]
Hello, i'm new to codeIgniter.
I was following the tutorial on 'news section'. I get the following error for the code in the controller:
Parse error: syntax error, unexpected T_PUBLIC in C:\wamp\application\controllers\news.php on line 21
Quote:<?php
class News extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('news_model');
}
public function index()
{
$data['news'] = $this->news_model->get_news();
}
public function view($slug)
{
$data['news'] = $this->news_model->get_news($slug);
}
}
public function index()
{
$data['news'] = $this->news_model->get_news();
$data['title'] = 'News archive';
$this->load->view('templates/header', $data);
$this->load->view('news/index', $data);
$this->load->view('templates/footer');
}