Skip to content

Instantly share code, notes, and snippets.

View mrailton's full-sized avatar

Mark Railton mrailton

View GitHub Profile
<?php
/**
* Display the specified blog post.
*/
public function show($slug)
{
$post = Post::where('slug', $slug)->first();
return View::make('blog.post', compact('post'));
<?php
require_once("includes/init.php");
// instantiate blog class
$blog = new Blog($db);
$posts = $blog->get_posts();
$lastpostdate = $blog->last_post_date();
header("Content-Type: application/xml; charset=UTF-8");
echo '<?xml version="1.0" encoding="UTF-8" ?>' .
'<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">'.
'<channel>' .