CodeIgniter错误 - 未定义属性:CI_Input :: $ post

0 php codeigniter

我是CodeIgniter的新手,我正在尝试使用下面的条件来确定表单是否已提交,然后显示某个视图(如果有).由于某种原因,我在标题中出现了错误,并且已经将问题排除了一半以上.有谁知道如何解决这个问题?谢谢!

if($this->input->post->lastName){

    // load view if form was submitted

} else {

    // load other view

}
Run Code Online (Sandbox Code Playgroud)

Jay*_*rox 6

尝试:

if($this->input->post('lastName')){

    // load view if form was submitted

} else {

    // load other view

}
Run Code Online (Sandbox Code Playgroud)