Skip to content

Instantly share code, notes, and snippets.

@sbward
Created March 15, 2013 22:15
Show Gist options
  • Save sbward/5173529 to your computer and use it in GitHub Desktop.
Save sbward/5173529 to your computer and use it in GitHub Desktop.
<?php
namespace MyApplication\Controller;
use Hydrogen\Controller;
use Hydrogen\MultiTemplateRenderer;
class Error extends Controller
{
use MultiTemplateRenderer;
public function error($message = "Server Error", $httpCode = 500)
{
// Checks for CLI automatically
// Uses a config variable to map to template file types
// (eg. CLI => ".cli.mustache")
$this->render('error', compact($message, $httpCode));
return $this->response;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment