Welcome Guest, Not a member yet? Register   Sign In
custom library with parameters : problem
#5

$this will only contain objects that are loaded before the view is loaded.
If you want to load classes in a view you must do it like this:

PHP Code:
$ci =& get_instance();
$ci->load->library('yourlibrary');
$ci->yourlibrary->get(); 

This is one of the reasons using $this in views should be avoided. Pass everything you need in your view via the data argument when loading a view
Reply


Messages In This Thread
RE: custom library with parameters : problem - by Martin7483 - 11-13-2015, 06:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB