public function Page::setParameter in Page Manager 8.4
Same name and namespace in other branches
- 8 src/Entity/Page.php \Drupal\page_manager\Entity\Page::setParameter()
Adds/updates a given parameter context.
Parameters
string $name: The parameter context name.
string $type: The parameter context type.
string $label: (optional) The parameter context label.
Return value
$this
Overrides PageInterface::setParameter
File
- src/
Entity/ Page.php, line 266
Class
- Page
- Defines a Page entity class.
Namespace
Drupal\page_manager\EntityCode
public function setParameter($name, $type, $label = '') {
$this->parameters[$name] = [
'machine_name' => $name,
'type' => $type,
'label' => $label,
];
// Reset contexts when a parameter is added or changed.
$this->contexts = [];
// Reset the contexts of every variant.
foreach ($this
->getVariants() as $page_variant) {
$page_variant
->resetCollectedContexts();
}
return $this;
}