July 2017
Intermediate to advanced
456 pages
11h 32m
English
The dropbutton type displays a set of links as drop-down buttons. The links can be themed separately from other links by creating a links--dropbutton.html.twig file, and you can also add a #subtype attribute to make it even more specific. For example, if you add '#subtype' => 'foo', the template suggestions will go:
Consider this example:
$form['test'] = array(
'#type' => 'dropbutton',
'#links' => array(
'action_one' => array(
'title' => $this->t('Action 1'),
'url' => new Url('<front>'),
),
'action_two' => array(
'title' => $this->t('Action 2'),
'url' => new Url('<front>'),
),
),
);
Read now
Unlock full access