RiddleView.php in Thunder 8.2
File
modules/thunder_article/modules/thunder_riddle/src/Plugin/EntityBrowser/Widget/RiddleView.php
View source
<?php
namespace Drupal\thunder_riddle\Plugin\EntityBrowser\Widget;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\entity_browser\Plugin\EntityBrowser\Widget\View;
class RiddleView extends View {
public function getForm(array &$original_form, FormStateInterface $form_state, array $additional_widget_parameters) {
$form = parent::getForm($original_form, $form_state, $additional_widget_parameters);
$form['actions']['import_riddle'] = [
'#title' => $this
->t('Import my riddles'),
'#type' => 'link',
'#attributes' => [
'class' => [
'button',
],
],
'#url' => Url::fromRoute('riddle_marketplace.import'),
];
return $form;
}
}