Skip to content

Instantly share code, notes, and snippets.

@gabriel403
Last active August 29, 2015 14:18
Show Gist options
  • Save gabriel403/edd610535fbb12c5da27 to your computer and use it in GitHub Desktop.
Save gabriel403/edd610535fbb12c5da27 to your computer and use it in GitHub Desktop.
<?php
// request comes in to router
$request = new Request($_GET, $_POST, $_SERVER);
$controllerName = $request->someAwesomeFunctionToWorkOutController(); // Product for instance
$actionName = $request->someAwesomeFunctionToWorkOutAction(); // get/new/index/whatever
$controller = new $controller;
//enable notification caching
NotificationCache::enableNotificationCrap();
$outputHtml = $controller->$actionName($request);
//by this point the whole request has been handled, all objects have been saved or changed or whatever
//so all we have to do to finish is process notifications and return html
NotificationCache::processCrap();
echo $outputHtml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment