开发者

CodeIgniter: Input class not being loaded (or so I think)

开发者 https://www.devze.com 2023-03-07 18:38 出处:网络
I\'m trying to work with the CI framework (PHP), and not having much luck with the core "Input" class.

I'm trying to work with the CI framework (PHP), and not having much luck with the core "Input" class.

Here's my code:

$user_name = $this->input->post('username');
$password = $this->input->post('password');

This is the result when I try to load the controller:

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Lo开发者_高级运维gin::$input

Filename: controllers/login.php

Line Number: 24

Any Tips?


Make sure that your controller extends CI_Controller and that you call the parent constructor in your own:

class Login extends CI_Controller {
    public function __construct() {
        parent::__construct();
    }
    /* the rest of your code... */
}
0

精彩评论

暂无评论...
验证码 换一张
取 消