Skip to content

Instantly share code, notes, and snippets.

@clarkf
Created September 28, 2013 00:57
Show Gist options
  • Select an option

  • Save clarkf/6737211 to your computer and use it in GitHub Desktop.

Select an option

Save clarkf/6737211 to your computer and use it in GitHub Desktop.
<?php
class RouterThing {
/* ... */
function fireController($controllerInstance, $action) {
/* ... setup ... */
$before = get_object_vars($controllerInstance);
$result = $controllerInstance->$action();
$scoped = array_diff($before, get_object_vars($controllerInstance));
$this->handleResponse($result, $scoped); // or whatever
}
/* ... */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment