adjust how the response is rendered, as well as move input flashing to after filter.
This commit is contained in:
parent
7a9631975f
commit
10b9001e13
|
@ -50,7 +50,7 @@
|
||||||
|
|
||||||
'after' => function($response)
|
'after' => function($response)
|
||||||
{
|
{
|
||||||
// Do stuff after every request to your application.
|
Input::flash();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -213,14 +213,6 @@
|
||||||
$response = Response::error('404');
|
$response = Response::error('404');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Stringify the response. We need to force the response to be
|
|
||||||
* stringed before closing the session, since the developer may
|
|
||||||
* be using the session within their views, so we cannot age
|
|
||||||
* the session data until the view is rendered.
|
|
||||||
*/
|
|
||||||
$response->content = $response->render();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close the session and write the active payload to persistent
|
* Close the session and write the active payload to persistent
|
||||||
* storage. The session cookie will also be written and if the
|
* storage. The session cookie will also be written and if the
|
||||||
|
@ -229,8 +221,6 @@
|
||||||
*/
|
*/
|
||||||
if (Config::$items['session']['driver'] !== '')
|
if (Config::$items['session']['driver'] !== '')
|
||||||
{
|
{
|
||||||
Input::flash();
|
|
||||||
|
|
||||||
IoC::core('session')->save($driver);
|
IoC::core('session')->save($driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -136,14 +136,17 @@ public function execute($method, $parameters = array())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The after filter and the framework expects all responses to
|
|
||||||
// be instances of the Response class. If the method did not
|
|
||||||
// return an instsance of Response, we will make on now.
|
|
||||||
if ( ! $response instanceof Response)
|
if ( ! $response instanceof Response)
|
||||||
{
|
{
|
||||||
$response = new Response($response);
|
$response = new Response($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stringify the response. We need to force the response to be
|
||||||
|
// stringed before closing the session, since the developer may
|
||||||
|
// be using the session within their views, so we cannot age
|
||||||
|
// the session data until the view is rendered.
|
||||||
|
$response->content = $response->render();
|
||||||
|
|
||||||
Filter::run($this->filters('after', $method), array($response));
|
Filter::run($this->filters('after', $method), array($response));
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
|
|
|
@ -111,14 +111,17 @@ public function call()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The after filter and the framework expects all responses to
|
|
||||||
// be instances of the Response class. If the route did not
|
|
||||||
// return an instsance of Response, we will make on now.
|
|
||||||
if ( ! $response instanceof Response)
|
if ( ! $response instanceof Response)
|
||||||
{
|
{
|
||||||
$response = new Response($response);
|
$response = new Response($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stringify the response. We need to force the response to be
|
||||||
|
// stringed before closing the session, since the developer may
|
||||||
|
// be using the session within their views, so we cannot age
|
||||||
|
// the session data until the view is rendered.
|
||||||
|
$response->content = $response->render();
|
||||||
|
|
||||||
$filters = array_merge($this->filters('after'), array('after'));
|
$filters = array_merge($this->filters('after'), array('after'));
|
||||||
|
|
||||||
Filter::run($filters, array($response));
|
Filter::run($filters, array($response));
|
||||||
|
|
Loading…
Reference in New Issue