简体   繁体   中英

Undefined property error when calling a library function

I have two controllers in user folder. One is user and othe one is profile. And also have a library called category_detail in category folder. when I call $this->category_detail->get_category_detail(2); in user controller it works well. But when I do same call in profile controller it gives an error. In both file I have loaded category_detail library in constructor. error is follows.

Severity: Notice

Message: Undefined property: Profile::$category_detail

Filename: user/profile.php

check this link

http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html

you have to put your library file in application/libraries folder

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM