Codeigniter Form Verification loading failed

Source: Internet
Author: User
Error message: {code...} Why does {code...} fail to load?

Error message:

php
  Load-> model ('Article _ model', 'post');} public function index () {$ this-> load-> view ('admin/post_list.html ');} public function add () {$ this-> load-> model ('category _ model', 'cate '); $ data ['category '] = $ this-> cate-> fetch (); $ this-> load-> helper ('form '); $ this-> load-> view ('admin/post_add.html ', $ data);} public function save () {$ this-> load-> library ('form _ validation ', 'verify'); $ status = $ this-> verify-> Run ('Article'); if ($ status) {$ data = array ('title' => $ this-> input-> post ('title '), 'cid' => $ this-> input-> post ('category '), 'date' => $ this-> input-> post ('date '), 'keyword' => $ this-> input-> post ('keyword'), 'description' => $ this-> input-> post ('description '), 'excerpt' => $ this-> input-> post ('excerpt'), 'thumbnail '=> $ this-> input-> post ('thumbnail '), 'Password' => $ this-> input-> post ('Password '),' Content '=> $ this-> input-> post ('content'); $ this-> post-> add ($ data); success ('admin/article ', 'Post added successfully');} else {$ this-> load-> helper ('form '); $ this-> load-> view ('admin/post_add.html ') ;}}}?>

Why?

php$this->load->library('form_validation', 'verify'); $this->load->model('category_model', 'cate');

Will these two loading fail?

Reply content:

Error message:

php
  Load-> model ('Article _ model', 'post');} public function index () {$ this-> load-> view ('admin/post_list.html ');} public function add () {$ this-> load-> model ('category _ model', 'cate '); $ data ['category '] = $ this-> cate-> fetch (); $ this-> load-> helper ('form '); $ this-> load-> view ('admin/post_add.html ', $ data);} public function save () {$ this-> load-> library ('form _ validation ', 'verify'); $ status = $ this-> verify-> Run ('Article'); if ($ status) {$ data = array ('title' => $ this-> input-> post ('title '), 'cid' => $ this-> input-> post ('category '), 'date' => $ this-> input-> post ('date '), 'keyword' => $ this-> input-> post ('keyword'), 'description' => $ this-> input-> post ('description '), 'excerpt' => $ this-> input-> post ('excerpt'), 'thumbnail '=> $ this-> input-> post ('thumbnail '), 'Password' => $ this-> input-> post ('Password '),' Content '=> $ this-> input-> post ('content'); $ this-> post-> add ($ data); success ('admin/article ', 'Post added successfully');} else {$ this-> load-> helper ('form '); $ this-> load-> view ('admin/post_add.html ') ;}}}?>

Why?

php$this->load->library('form_validation', 'verify'); $this->load->model('category_model', 'cate');

Will these two loading fail?

/** * Class Loader * * This function lets users load and instantiate classes. * It is designed to be called from a user's app controllers. * * @access  public * @param   string  the name of the class * @param   mixed   the optional parameters * @param   string  an optional object name * @return  void */

The second parameter is the _ construct parameter, and the third parameter is the optional object name.

It cannot be renamed when loading the class library...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.