Created
December 5, 2010 21:41
-
-
Save mfolnovic/729496 to your computer and use it in GitHub Desktop.
PHP Controllers with Filters (Rails-like)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* This example shows how usage of rails filters could look like in php */ | |
class NewsController { | |
/** | |
* @before_filter online | |
* @cache (ttl: 3600) | |
*/ | |
public function show() { | |
... | |
} | |
private function online() { | |
return isset($_SESSION["ID"]); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment