Skip to content

Instantly share code, notes, and snippets.

@jawngee
Created July 15, 2009 09:07
Show Gist options
  • Save jawngee/147598 to your computer and use it in GitHub Desktop.
Save jawngee/147598 to your computer and use it in GitHub Desktop.
<?
class PostController extends Controller
{
public function index($post_id)
{
if (is_numeric($post_id))
{
$post=Model::Instance("blog.post",$post_id);
if ($post)
return array('post'=>$post);
}
throw new NotFoundException("Could not find post $post_id.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment