Using a class as property in another class |
I am using CI for years. I only have controllers, so no views or model classes.
I migrated to the latest version 3.1.5 by unzipping the CI zip file and only copying my \application\*.php files. I read all migration stuf and googled on it. In my file Ezbuild_ezm_tools.php I got this issue: When I am running this code working fine on CI 2. PHP Code: $this->mm = new Ezbuild_ezm_mm (); I got this message on CI. Unable to locate the specified class: Session.php Ezbuild_ezm_mm is also an other extension of CI_controller. When I remove this previous line no error message. So the cause of the error is determined. So I tried/changed the line to this: PHP Code: $this->load->library('ezbuild_ezm_mm'); This generates a new issue: Undefined property: Ezbuild_ezm_tools::$ezbuild_ezm_mm on this line PHP Code: $this->ezbuild_ezm_mm->say_hello(); My classes are renamed according the 3 way like this: PHP Code: class Ezbuild extends CI_Controller { After this i am extending all my classes like this: PHP Code: require_once("Ezbuild.php"); Any help appreciated! Thanks in advance. John
08-24-2017, 02:29 AM
(This post was last modified: 08-24-2017, 02:30 AM by InsiteFX. Edit Reason: spelling error )
Your problem is that it's not finding the session class from 2x to 3x
the session is now in it's own folder. ./system/libraries/Session/Session.php There is also an Interface and Driver for the new Session library. That's your problem not the Controller. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(08-24-2017, 02:29 AM)InsiteFX Wrote: Your problem is that it's not finding the session class from 2x to 3x Nope. His problem is very much that his libraries extend CI_Controller. |
Welcome Guest, Not a member yet? Register Sign In |