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

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

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

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 !