Welcome Guest, Not a member yet? Register   Sign In
Keen to help another newb with the news tutorial?
#1

[eluser]sjaxso[/eluser]
I'm struggling a bit with a 500 error. I'm sure it's something dumb but I can't fix it:

PHP Parse error: syntax error, unexpected T_PUBLIC in /var/www/vhosts/***.com/ci/application/controllers/news.php on line 11

Here's my news.php

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

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();
                $data['title'] = 'News archive';

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

        }

        public function view($slug)
        {
                $data['news'] = $this->news_model->get_news($slug);
        if (empty($data['news_item']))
        {
                show_404();
        }

        $data['title'] = $data['news_item']['title'];

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


Messages In This Thread
Keen to help another newb with the news tutorial? - by El Forum - 01-09-2013, 05:44 PM
Keen to help another newb with the news tutorial? - by El Forum - 01-09-2013, 06:47 PM
Keen to help another newb with the news tutorial? - by El Forum - 01-09-2013, 06:49 PM
Keen to help another newb with the news tutorial? - by El Forum - 01-09-2013, 07:20 PM
Keen to help another newb with the news tutorial? - by El Forum - 01-09-2013, 07:27 PM
Keen to help another newb with the news tutorial? - by El Forum - 01-09-2013, 07:36 PM
Keen to help another newb with the news tutorial? - by El Forum - 01-09-2013, 07:37 PM
Keen to help another newb with the news tutorial? - by El Forum - 01-09-2013, 07:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB