public function SettingTrait::render_array in Fasttoggle 8.2
Return a render array for an instance of this setting.
File
- src/
Plugin/ Setting/ SettingTrait.php, line 381 - Fasttoggle Object List of Values Setting
Class
- SettingTrait
- Abstract interface for settings.
Namespace
Drupal\fasttoggle\Plugin\SettingCode
public function render_array($wrapper_id, $link_text, $url_args) {
return [
'#prefix' => "<div id='fasttoggle-{$wrapper_id}'>",
'#suffix' => '</div>',
'#type' => 'link',
'#title' => $link_text,
'#attributes' => [
'class' => [
'use-ajax',
],
],
'#url' => Url::fromRoute('fasttoggle.toggle', $url_args),
];
}