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...