<?php
class Customer extends CI_controller
{
public function __construct()
{
parent::__construct();
$this->load->model('Customer_model');
}
public function create()
{
$this->load->helper('form');
$this->load->library('form_validation');
$this->form_validation->set_rules('name', 'Title', 'required');
$this->form_validation->set_rules('address', 'text', 'required');
if ($this->form_validation->run() === FALSE)
{
$this->load->helper('url');
$this->load->view('templates/header');
$this->load->view('master/customer');
}
else
{
$this->Customer_model->register();
$this->load->view('templates/header');
$this->load->view('templates/success');
}
}
}
我已使用此代码成功地将数据插入到表中。在我尝试显示相同的标题模板和中心部分(success.php)后,它显示一个空白页面。评论标题页面后,它正在工作 IE 成功页面即将到来。