I'm using controller/method as callbacks to application routes.
E.g.:
$app->get('/user/login', array('User', 'login'));
Here is the sample User
class:
Class User {
public function login() {
print 'Login page.';
}
}
How can I make the $app
variable available automatically in all classes?
I know I can get it using getInstance()
method, but I need to call it manually every time.
Thanks!