Hi everyone!
I’m developing an application, and have some problems using the libraries i’m creating.
Details below:
.:::. Inside /application/libraries/ folder i have to files:
Soap.php
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Soap extends CI_Controller {
public function __construct() {
parent::__construct();
}
public function getAlgo() {
return "algo";
}
}
Demo.php
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Demo extends CI_Controller {
public function __construct() {
parent::__construct();
}
public function getDemo() {
return "Demo";
}
}.:::. Inside /application/controllers/ folder i have a controller:
sce.php
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Sce extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->helper('url');
$this->load->library('session');
$this->load->library('encrypt');
$this->load->library('soap');
$this->load->library('demo');
}
public function showSCE() {
echo $this->soap->getAlgo();
echo $this->demo->getDemo();
}
}
?>
:::. Executing: http://localhost/app_demo/index.php/sce/showSCE
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Sce::$demo
Filename: controllers/sce.phpFatal error: Call to a member function getDemo() on a non-object in
C:\xampp\htdocs\app_demo\application\controllers\sce.php on line xx
.:::. This error shows up when I use the two libraries, but if i only use one works !!!!!. Someone who can help me?