Skip to content

Instantly share code, notes, and snippets.

@bakura10
Created December 18, 2015 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bakura10/89c46482972b1e2bebf1 to your computer and use it in GitHub Desktop.
Save bakura10/89c46482972b1e2bebf1 to your computer and use it in GitHub Desktop.
<?php
class MyMiddleware
{
private $mapping;
public function __invoke($request, $response, $out)
{
$var = $request->getAttribute('job');
$middleware = $this->mapping[$var];
// I need to fetch $middlware and execute it
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment