public function newreg()
{
$username = $this->input->post('username');
$password = $this->input->post('password');
$this->load->model('register_model');
$data['list']=$this->register_model->add($username, $password);
$this->load->view('register_display', $data);
}
这是名为 register.php 的 Controller 的一部分
调用此函数后,我在屏幕上看到的只是空白。
这个函数是一个工作 Controller 的精确副本。仅更改文件名(模型、 View )
我不知道问题出在哪里。
您可以通过启用 CI 日志
轻松检查整个环境中发生的情况,
转到 config/config.php
并编辑它:
/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| If you have enabled error logging, you can set an error threshold to
| determine what gets logged. Threshold options are:
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 0; //put this to 4
然后,如果您的/application 文件夹中还没有 /logs
文件夹,请创建它并向其中添加 775 chmod
(仅限日志文件夹)。
更新: 您还必须 chown apache:apache logs
以便 apache 能够在该文件夹中写入。
通过浏览器运行您的应用程序并检查您的/logs
文件夹中的log.php
文件,它将包含所有应用程序错误
.