How to call library function from one library to another library |
[eluser]MASS MASS[/eluser]
Can anybody provide me to get library function call......... I have two library(own created)......... 1>photo 2>gallery in photo library different function .......like check,verfiy....... How to call check function in gallery library from photo library......this is my question
[eluser]eggshape[/eluser]
In a standard, general way, you would include_once() or require_once() the gallery library file, and if the gallery library is a class with a nonstatic function, you instantiate the class: Code: $gallery = new Gallery(); from your photo library. If the function is a static function, use Gallery::whatever-function() and you do not need to instantiate the class (assumes your gallery library is written as a class called Gallery). For CI, you just put the libraries in your libraries directory, and load->library(gallery)...assuming this is a class. If the Gallery library is not a class and just a series of functions (similar to CodeIgniter helpers), put the file in your helpers directory, and use load->helper() if your using CI. Otherwise, include/require the file and call your function.
[eluser]MASS MASS[/eluser]
Hi eggshape I am using CI.......... i create class libraries same like CI format.......... Can you provide in code format............
[eluser]nmweb[/eluser]
http://ellislab.com/codeigniter/user-gui...aries.html Under 'Utilizing CodeIgniter Resources within Your Library' This can be applied to user libraries as well. In the photo library Code: $CI =& get_instance();
[eluser]MASS MASS[/eluser]
Thank you for great support.......nmweb and eggshape Its working |
Welcome Guest, Not a member yet? Register Sign In |