protected function PanelsDisplayVariant::renderPageTitle in Panels 8.3
Same name and namespace in other branches
- 8.4 src/Plugin/DisplayVariant/PanelsDisplayVariant.php \Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant::renderPageTitle()
Renders the page title and replaces tokens.
Parameters
string $page_title: The page title that should be rendered.
Return value
string The page title after replacing any tokens.
1 call to PanelsDisplayVariant::renderPageTitle()
- PanelsDisplayVariant::build in src/
Plugin/ DisplayVariant/ PanelsDisplayVariant.php - Builds and returns the renderable array for the display variant.
File
- src/
Plugin/ DisplayVariant/ PanelsDisplayVariant.php, line 486
Class
- PanelsDisplayVariant
- Provides a display variant that simply contains blocks.
Namespace
Drupal\panels\Plugin\DisplayVariantCode
protected function renderPageTitle($page_title) {
$data = $this
->getContextAsTokenData();
// Token replace only escapes replacement values, ensure a consistent
// behavior by also escaping the input and then returning it as a Markup
// object to avoid double escaping.
// @todo: Simplify this when core provides an API for this in
// https://www.drupal.org/node/2580723.
$title = (string) $this->token
->replace(new HtmlEscapedText($page_title), $data);
return Markup::create($title);
}