Welcome Guest, Not a member yet? Register   Sign In
How to use my own library multiple times
#2

Suppose in your library you had a file called Library_test that looked like this:

PHP Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 

class 
Library_test {
 
 public function test_function($a$b)
 
 {
 
      // just add them up
 
      $c $a $b;
 
      return $c;
 
 }


Then in your controller you would load the library and use this:

PHP Code:
 $this->load->library('library_test');
 
 
 $result $this->library_test->test_function(24); 

I hope that helps,

Best wishes,

Paul.
Reply


Messages In This Thread
RE: How to use my own library multiple times - by PaulD - 11-02-2015, 11:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB