Welcome Guest, Not a member yet? Register   Sign In
Parse error: syntax error, unexpected T_PUBLIC in /var/www/html/beta/ci/application/models/news_model.php on line 10
#1

[eluser]GioMBG[/eluser]
Hi ALL,
nevbie ci
I PERFECTLY follow the tutorial CodeIgniter User Guide Version 2.1.4
obviously something is approximate

Parse error: syntax error, unexpected T_PUBLIC in /var/www/html/beta/ci/application/models/news_model.php on line 10

Code:
<?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');
}

suggestions ?
thx
#2

[eluser]noideawhattotypehere[/eluser]
You have an error in your model, not controller.




Theme © iAndrew 2016 - Forum software by © MyBB