Skip to content

Instantly share code, notes, and snippets.

@tarnfeld
Created February 5, 2012 23:22
Show Gist options
  • Select an option

  • Save tarnfeld/1748374 to your computer and use it in GitHub Desktop.

Select an option

Save tarnfeld/1748374 to your computer and use it in GitHub Desktop.
<?php
class Controller_Post extends \Controller_Template
{
public $template = 'templates/page';
public function action_index()
{
\Response::redirect("/");
}
public function action_show()
{
$tiny = $this->param("tiny");
if (!$post = \Model_Post::PostFromTiny($tiny))
{
throw new HttpNotFoundException;
}
if (!$asset = $post->asset)
{
throw new HttpNotFoundException;
}
$this->template->page_title = $post->title;
$this->template->body = \View::Forge("post/show", array("post" => $post, "asset" => $asset));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment