Skip to content

Instantly share code, notes, and snippets.

View sbward's full-sized avatar
🌱
plant-powered programming

Sam Ward sbward

🌱
plant-powered programming
  • Wellington, New Zealand
  • 06:31 (UTC +12:00)
View GitHub Profile
<?php
class ExceptionAction extends Action
{
public function __construct(Exception $exception, $debugMode = false)
{
$this->exception = $exception;
$this->debugMode = $debugMode;
$this->template = new Template(__TEMPLATES__.'/Debug/Exception.phtml'); // or whatever
}
@sbward
sbward / gist:5173220
Created March 15, 2013 21:26
An error handling controller prototype
<?php
namespace MyApplication\Controller;
use Hydrogen\Controller;
use Hydrogen\TemplateRenderer;
class Error extends Controller
{
use TemplateRenderer;
<?php
namespace MyApplication\Controller;
use Hydrogen\Controller;
use Hydrogen\MultiTemplateRenderer;
class Error extends Controller
{
use MultiTemplateRenderer;
@sbward
sbward / Error.php
Last active December 15, 2015 00:29
<?php
namespace MyApplication\Controller;
use Hydrogen\Controller;
use Hydrogen\MultiTemplateRenderer;
class Error extends Controller
{
use MultiTemplateRenderer;
,
,-. _,---._ __ / \
/ ) .-' `./ / \
( ( ,' `/ /|
\ `-" \'\ / |
`. , \ \ / |
/`. ,'-`----Y |
( ; | '
| ,-. ,-' | /
| | ( | | /
// John's code
$array = [
'fuwhefuiwe' => new Thing(wefuhwe, wefiuwehfuw, json_encode(weifuhwe)),
'uiwefhiwe' => new Thing(weuifhwegtrtrhrth, weoifwe, json_encode(weiufwe)),
'fuw' => new Thing(ef, gfe, json_encode(regfre)),
'fuwhefuiwe' => new Thing(wefuhwe, wefiuwehfuw, son_encode(weifuhwe)),
'uiwefhiwe' => new Thing(weuifdsfghwe, weoifwe, json_encode(weiufwe)),
'fuw' => new Thing(ef, gfe, json_encode(regfre)),
'fuwhefuiwe' => new Thing(wefuhwe, wefiuwehfuw, json_encode(weifuhwe)),
'uiwefhiwe' => new Thing(weuidfgfhwe, weoifwe, json_encode(weiufwe)),
$a = new Thing (a, b);
$cccc = new OtherThing (x, y, z);
$ddddd = new AnotherThing(m);
{
"href": "http://api.x.io/orders/42",
"data": {
"properties": {
"orderNumber": 42,
"itemCount": 3,
"status": "pending"
},
"links": [
{ "rel": [ "profile" ], "href": "/profiles/order" },
{
"class": [ "order" ],
"properties": {
"orderNumber": 42,
"itemCount": 3,
"status": "pending"
},
"entities": [
{
"class": [ "items", "collection" ],
<ul data-zc-options id="track_render">
<li class="active">HTML 5</li>
<li>Flash</li>
<li>SVG</li>
<li>Image</li>
<li>VML</li>
</ul>