• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Class

#1
How to load another class method from a different class?
Thanks
Reply

#2
(09-10-2018, 02:26 AM)frankenestain Wrote: How to load another class method from a different class?
Thanks
what do you mean with class?
library, controller, model?
Reply

#3
Perhaps this?
https://www.codeigniter.com/user_guide/g...ur-library

It's not limited to just CI resources, you can call your own libraries and methods using the same instance.
Reply

#4
I'm not sure, but if you have logic that you wish to use across different controllers, perhaps you should put that inside a model. That way you can access that logic from any controller.
Practical guide to IgnitedCMS - Book coming soon
Reply

#5
Let's say you have a library called Assets.php (in the application/libraries folder), and this class has a method called create_header() which returns a string.

In your controller:
PHP Code:
$this->load->library('assets');
$hdr $this->assets->create_header(); 

Is this the information you were looking for?
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.