[SOLVED]Class as Library |
HI , i try to use this class :
https://github.com/bluerhinos/phpMQTT as library . I change class name as PhpMQTT and load the library : Code: $params = array('address' => $server, 'port' => $port ,'clientid' => $client_id ); but when i call a method of library i have : Message: Undefined property: Ajax_call_device::$phpMQTT on line 283 this is the 283 line : if ($this->phpMQTT->connect(true, NULL, $username, $password)) How can i solve ?
If you change the name of the class you need to change it where ever it is called also.
So all those errors if you look at them they have the wrong class name because you changed it. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(11-15-2020, 02:00 PM)InsiteFX Wrote: If you change the name of the class you need to change it where ever it is called also. The class (library ) are correctly loaded , i have not error in the row where i load it... I see that the class are loaded either with PhpMQTT and phpMQTT (because i havent error , if i add a letter as APhpMQTT i have Unable to load the requested class: APhpMQTT instead ) But ever the same error (on console with ajax) : Message: Undefined property: Ajax_call_device::$phpMQTT in this row : if ($this->phpMQTT->connect(true, NULL, $username, $password)) {
Your two errors undefind properties are the naming of the class find those two method's and
change them to match the library class name. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |