Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
Enlight_Controller_Request_RequestHttp example
$exception
=
$args
->
getResponse
(
)
->
getException
(
)
;
$this
->
handleException
(
$exception
[
0
]
)
;
}
/** * @param Exception $exception * * @throws Exception */
private
function
handleException
(
$exception
)
{
$request
=
new
Enlight_Controller_Request_RequestHttp
(
)
;
$response
=
new
Enlight_Controller_Response_ResponseHttp
(
)
;
if
(
$this
->
isModelException
(
$exception
)
)
{
$generator
=
$this
->container->
get
(
ModelManager::
class
)
->
createModelGenerator
(
)
;
$result
=
$generator
->
generateAttributeModels
(
)
;
if
(
$result
[
'success'
]
=== true
)
{
$response
->
setRedirect
(
$request
->
getRequestUri
(
)
)
;
setcookie
(
self::redirectCookieString, '1',
time
(
)
+ 5
)
;