Created
March 30, 2012 00:00
-
-
Save alganet/2245063 to your computer and use it in GitHub Desktop.
Seamless Respect Framework
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 | |
//A framework built entirely by components, no conectors (this is a mock!) | |
use Respect\Template; | |
use Respect\Validation as v; | |
use Respect\Rest; | |
use Respect\Persistence; | |
$router = new Rest; | |
$mapper = new Relational; | |
$template = new Template; | |
$router->get('/users/*', function($username) use ($mapper) { | |
return $mapper->user(compact('username'))->fetch(); | |
})->accept(array( | |
'text/html' => $template('users.html'); | |
))->when(v::attribute('username')->alnum('_')->length(1,15)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @augustohp look at this.