Postingan lainnya
ikuti video tutorial bagian Memasukkan data, terjadi syntax error
ketika saya ikuti video tutorial bagian Memasukkan data, terjadi syntax error... Message: syntax error, unexpected end of file, expecting function (T_FUNCTION)...Line Number: 42 contoh kasus ini saya mengunakan CodeIgniter-3.1.5, MOHON pencerahan. terima kasih
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class News extends CI_Controller {
public function __construct(){
parent::__construct();
$this->load->model('news_model');
$this->load->helper('url_helper');
}
public function index()
{
$data['news'] = $this->news_model->get_news();
$data['title'] = 'Arsip berita';
$this->load->view('news/index', $data);
}
public function view($slug = NULL)
{
$data['news_item'] = $this->news_model->get_news($slug);
$this->load->view('news/view', $data);
}
public function create(){
$this->load->helper('form');
$this->load->library('form_validation');
$this->form_validation->set_rules('title', 'Judul', 'required');
$this->form_validation->set_rules('text', 'Text', 'required');
if($this->form_validation->run() === FALSE){
$this->load->view('news/create');
}else{
$this->news_model->set_news();
redirect('news');
}
}
0
2 Jawaban:
Kurang penutup kurung kurawal dari pmbuka classnya gan, coba tambahin } di paling akhir
0