/** * Destroy the test enviornment. */ public function tearDown() { $_SERVER = array(); Router::$routes = array(); Router::$names = array(); Router::$uses = array(); Router::$fallback = array(); Config::set('application.ssl', true); Config::set('application.url', ''); Config::set('application.index', 'index.php'); }
/** * Generate a URL to a controller action. * * <code> * // Generate a URL to the "index" method of the "user" controller * $url = URL::to_action('user@index'); * * // Generate a URL to http://example.com/user/profile/taylor * $url = URL::to_action('user@profile', array('taylor')); * </code> * * @param string $action * @param array $parameters * @return string */ public static function to_action($action, $parameters = array()) { // This allows us to use true reverse routing to controllers, since // URIs may be setup to handle the action that do not follow the // typical Laravel controller URI conventions. $route = Router::uses($action); if (!is_null($route)) { return static::explicit($route, $action, $parameters); } else { return static::convention($action, $parameters); } }
public static function to_action($action, $parameters = array()) { $route = Router::uses($action); if (!is_null($route)) { return static::explicit($route, $action, $parameters); } else { return static::convention($action, $parameters); } }