Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setLandingPage example
$landingPage
=
$this
->landingPageRoute->
load
(
$landingPageId
,
$request
,
$context
)
->
getLandingPage
(
)
;
if
(
$landingPage
->
getCmsPage
(
)
=== null
)
{
throw
new
PageNotFoundException
(
$landingPageId
)
;
}
$page
=
$this
->genericPageLoader->
load
(
$request
,
$context
)
;
$page
= LandingPage::
createFrom
(
$page
)
;
$page
->
setLandingPage
(
$landingPage
)
;
$metaInformation
=
new
MetaInformation
(
)
;
$metaTitle
=
$landingPage
->
getMetaTitle
(
)
??
$landingPage
->
getName
(
)
;
$metaInformation
->
setMetaTitle
(
$metaTitle
?? ''
)
;
$metaInformation
->
setMetaDescription
(
$landingPage
->
getMetaDescription
(
)
?? ''
)
;
$metaInformation
->
setMetaKeywords
(
$landingPage
->
getKeywords
(
)
?? ''
)
;
$page
->
setMetaInformation
(
$metaInformation
)
;
$this
->eventDispatcher->
dispatch
(
new
LandingPageLoadedEvent
(
$page
,
$context
,
$request
)
)
;