我在CodeIgniter 2上反馈了非ajax表格。我希望在表单成功提交后显示通知。这是怎么回事?
答案 0 :(得分:2)
基本示例,这是过度简化的,因此可以很容易理解:
控制器
if ($this->form_validation->run()) // Your logic that tells if the submit was OK
{
$data['message'] = 'Thanks.';
}
else
{
$data['message'] = 'There was an error.';
}
$this->load->view('my_view', $data);
查看
<?php echo $message; ?>