Created
June 10, 2012 02:19
-
-
Save JosephLenton/2903598 to your computer and use it in GitHub Desktop.
get blog post
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
<? | |
get( '/blog/show/{title}' )-> | |
validate( function( $title, &$post ) { $post = $this->model->posts->get( $title ); } )-> | |
action( | |
function( $post ) { | |
$this->view( 'blog/post', $post ); | |
}, | |
function( $title ) { | |
$this->view( '404', "Blog post not found " . h($title) ); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment