Skip to content

Instantly share code, notes, and snippets.

@jehoshua02
Created March 13, 2012 20:53
Show Gist options
  • Save jehoshua02/2031500 to your computer and use it in GitHub Desktop.
Save jehoshua02/2031500 to your computer and use it in GitHub Desktop.
extract() example
<?php
class Router {
// ...
private function _action_string($parsed_action)
{
// without extract
$parsed_action['params'] = implode('/', $parsed_action['params']);
$action = implode('/', array($parsed_action['controller_name'], $parsed_action['mehtod'], $parsed_action['params']));
// with extract
extract($parsed_action);
$params = implode('/', $parsed_action['params']);
return implode('/', array($controller_name, $method, $params));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment