CodeIgniter Forums
Create 'alias' for library function - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Create 'alias' for library function (/thread-45717.html)



Create 'alias' for library function - El Forum - 10-03-2011

[eluser]Unknown[/eluser]
I used to code very, very badly, once upon a time (I hope it's behind me now), and did some sql work (mysql_query etc) in a helper.
Now, I want to make that helper a library : easy. But the functions in this helper are called many times... Do I have to reread all my application and replace 'sqlfunction()' by '$this->sql_lib->sqlfunction()', or can I create sort of an alias for $this->sql_lib->sqlfunction(), which would be called when I write sqlfunction() ?
Thank you in advance !