Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setCookies example
$front
->
dispatch
(
)
;
if
(
$followRedirects
&&
$this
->
Response
(
)
->
getStatusCode
(
)
=== Response::HTTP_FOUND
)
{
$link
=
parse_url
(
$this
->
Response
(
)
->
getHeader
(
'Location'
)
, PHP_URL_PATH
)
;
if
(
$link
=== false
)
{
throw
new
RuntimeException
(
'Could not redirect as the "Location" header is not set'
)
;
}
$this
->
resetResponse
(
)
;
$cookies
=
$this
->
Response
(
)
->
getCookies
(
)
;
$this
->
resetRequest
(
)
;
$this
->
Request
(
)
->
setCookies
(
$cookies
)
;
return
$this
->
dispatch
(
$link
)
;
}
/** @var Enlight_Controller_Plugins_ViewRenderer_Bootstrap $viewRenderer */
$viewRenderer
=
$front
->
Plugins
(
)
->
get
(
'ViewRenderer'
)
;
$this
->_view =
$viewRenderer
->
Action
(
)
->
View
(
)
;
return
$response
;
}