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

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Create 'alias' for library function (/showthread.php?tid=45717)



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 !