Update Slim Framework to Version 2.5.0.

This commit is contained in:
kiswa 2015-01-12 10:01:49 -05:00
parent c1440198b0
commit ea8baa3d95
4 changed files with 20 additions and 2 deletions

View File

@ -89,7 +89,7 @@ class PrettyExceptions extends \Slim\Middleware
$message = $exception->getMessage();
$file = $exception->getFile();
$line = $exception->getLine();
$trace = str_replace(array('#', '\n'), array('<div>#', '</div>'), $exception->getTraceAsString());
$trace = str_replace(array('#', "\n"), array('<div>#', '</div>'), $exception->getTraceAsString());
$html = sprintf('<h1>%s</h1>', $title);
$html .= '<p>The application could not run because of the following error:</p>';
$html .= '<h2>Details</h2>';

View File

@ -288,6 +288,9 @@ class Route
public function appendHttpMethods()
{
$args = func_get_args();
if(count($args) && is_array($args[0])){
$args = $args[0];
}
$this->methods = array_merge($this->methods, $args);
}
@ -298,6 +301,9 @@ class Route
public function via()
{
$args = func_get_args();
if(count($args) && is_array($args[0])){
$args = $args[0];
}
$this->methods = array_merge($this->methods, $args);
return $this;

View File

@ -1099,6 +1099,18 @@ class Slim
$this->response->redirect($url, $status);
$this->halt($status);
}
/**
* RedirectTo
*
* Redirects to a specific named route
*
* @param string $route The route name
* @param array $params Associative array of URL parameters and replacement values
*/
public function redirectTo($route, $params = array(), $status = 302){
$this->redirect($this->urlFor($route, $params), $status);
}
/********************************************************************************
* Flash Messages

View File

@ -108,7 +108,7 @@ class View
* @param string $key
* @param mixed $value
*/
public function keep($key, Closure $value)
public function keep($key, \Closure $value)
{
$this->data->keep($key, $value);
}