Skip to content

Instantly share code, notes, and snippets.

@remcoros
Created February 8, 2011 23:38
Show Gist options
  • Save remcoros/817533 to your computer and use it in GitHub Desktop.
Save remcoros/817533 to your computer and use it in GitHub Desktop.
BlogFrontpage.php: (view)
<h1>
<?= Model->Blog->Name ?>
</h1>
<h2>
<?= Model->Blog->TagLine ?>
</h2>
----
BlogPost.php: (view)
<h1>
<?= Model->PostTitle ?>
</h1>
<h2>
<?= Helper->FormatNiceDateTime( Model->PostDate ) ?>
</h2>
----
BlogController.php: (controller)
class BlogController
{
// www....nl/
public function Index()
{
var blogData = BlogDatabase->GetBlogInfo();
RenderView(blogData);
}
// www....nl/2010/blablabla_post
public function ViewPost(string $slug)
{
var postData = BlogDatabase->GetBlogPost($slug);
RenderView(postData);
}
}
----
BlogInfo.php (model):
class BlogInfo
{
public $Name;
public $TagLine;
}
----
BlogPost.php (model):
class BlogInfo
{
public $PostTitle;
public $PostDate;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment