user3522457
user3522457

Reputation: 2963

load codeigniter input library

$this->load->library("input"); 

what is the point of loading above code? found it in someone's code. This is the function :

public function do_add(){
    $this->load->library("input");
    $title = $this->input->post("title");
    $text = $this->input->post("text");

    $this->load->model("post_model", "model");
    $this->model->add($title, $text);

    redirect(site_url("post"));
}

Upvotes: 0

Views: 3578

Answers (1)

Walid Ammar
Walid Ammar

Reputation: 4128

From Codeigniter user guide:

Note: This class is initialized automatically by the system so there is no need to do it manually.

Upvotes: 3

Related Questions