StyleguidePatternListBuilder.php in Simple Style Guide 8
File
src/StyleguidePatternListBuilder.php
View source
<?php
namespace Drupal\simple_styleguide;
use Drupal\Core\Config\Entity\DraggableListBuilder;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
class StyleguidePatternListBuilder extends DraggableListBuilder {
public function getFormId() {
return 'sample_config_entity_ball_form';
}
public function buildHeader() {
$header['label'] = $this
->t('Name');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label();
return $row + parent::buildRow($entity);
}
public function submitForm(array &$form, FormStateInterface $form_state) {
parent::submitForm($form, $form_state);
$this
->messenger()
->addMessage('Styleguide pattern settings updated.');
}
}