private function Instances::buildUpdateButton in Smart Date 3.x
Same name and namespace in other branches
- 8.2 modules/smart_date_recur/src/Controller/Instances.php \Drupal\smart_date_recur\Controller\Instances::buildUpdateButton()
Add a link to update the parent entity.
Return value
array A render array of the button link.
1 call to Instances::buildUpdateButton()
- Instances::render in modules/
smart_date_recur/ src/ Controller/ Instances.php - Builds the render array for the listings.
File
- modules/
smart_date_recur/ src/ Controller/ Instances.php, line 190
Class
- Instances
- Provides listings of instances (with overrides) for a specified rule.
Namespace
Drupal\smart_date_recur\ControllerCode
private function buildUpdateButton() {
// Also insert a link to the interface for managing interfaces.
$url = Url::fromRoute('smart_date_recur.apply_changes', [
'rrule' => $this->rrule
->id(),
]);
$instances_link = Link::fromTextAndUrl(t('Apply Changes'), $url);
$instances_link = $instances_link
->toRenderable();
// Add some attributes.
$instances_link['#attributes'] = [
'class' => [
'button',
'button--primary',
],
];
$instances_link['#weight'] = 100;
return $instances_link;
}