Welcome Guest, Not a member yet? Register   Sign In
always check if a class has been previously loaded ?
#3

Generally, $this->load->xyz() and $this->lang->load() are fairly intelligent about checking whether something has been loaded. For example, if you're loading a language file which has previously been loaded, it won't be reloaded. However, if you're loading a language file which was loaded previously under a different language, it will reload the file for the new language.

However, you may be able to perform a more efficient check in your code than that used by the method in question and save yourself a small amount of time for subsequent calls to load the same model or library. It's not necessarily worth the effort, because $this->load->model() and $this->load->library() should never cause any problems by being called for a model or library which has already been loaded, but it could make a small difference in extreme cases.
Reply


Messages In This Thread
RE: always check if a class has been previously loaded ? - by mwhitney - 04-20-2015, 10:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB