Welcome Guest, Not a member yet? Register   Sign In
& get_instance() vs $this

When you use =&get_instance() you pass object by reference. Thats mean you don't create a new object, you only operate on existing object.
You MUST use get_instance() if u want model object or library object in for example another library. In controller you extend CI_controller, in __construct() it use get_instance() so you have access to created instances of model, libraries or something else.

Messages In This Thread
& get_instance() vs $this - by rahulemaity - 06-08-2017, 11:43 AM
RE: & get_instance() vs $this - by NickOver - 06-08-2017, 01:09 PM
RE: & get_instance() vs $this - by skunkbad - 06-08-2017, 04:19 PM

Theme © iAndrew 2016 - Forum software by © MyBB