Library
Library is a file of collection of file that you can use inside Seme Framework. You can found our library on kero/lib/
. Seme Framework has 3 method for loading library.
- instantiate library object automatically,
- instantiate object of library by using different name
- include only library file, so you can instantiate by using its class name.
Loading A Library
You can load library from controller by using method lib. Method lib has 3 parameter required:
- Location of library file relative to kero/lib/.
- Object name, default name is class name with in lower case format.
- The include method. you can use inc value if you just require_once only your lib. Otherwise library will instantiate automatically.
Example loading json library in home controller:
Class Home extends SENE_Controller { $this->lib('sene_json_engine','sene_json'); public function __construct(){ parent::__construct(); } public function index(){ $data = array(); $data["status"] = 200; $data["message"] = 'Hello we just use json right here, Yi-Ha!'; $data["result"] = array(); $this->sene_json->out($data); } }
After that you can open your base_url on browser and see what you get.
List of Library
Here is the list of library currently exist on seme framework: