Reputation: 545
i just want to know
how i must create code shortcut in php
i see phpfox script its just use:
//for get user id
Phpfox::getUserId();
//when user most be logged in
Phpfox::isUser(true);
//or user must be admin for do this action
Phpfox::isAdmin(true);
//or this for insert query
Phpfox::getLib('database')->query("")
//so i can get user id easy with this simple code
$userid = Phpfox::getUserId();
so these are shortcut yes?
for run some codes and return something just like call function
so how can i create something like this? for call it for get something...
Upvotes: 0
Views: 278
Reputation: 683
I guess you are talking talking about static class methods or functions or class constants..
Upvotes: 0
Reputation: 94
If i understand your question correctly, you should read about Database Abstraction Layer..
http://pear.php.net/package/DB
Upvotes: 1