LanguageSelectionPageConditionTitle.php in Language Selection Page 8.2
File
src/Plugin/LanguageSelectionPageCondition/LanguageSelectionPageConditionTitle.php
View source
<?php
declare (strict_types=1);
namespace Drupal\language_selection_page\Plugin\LanguageSelectionPageCondition;
use Drupal\Core\Form\FormStateInterface;
use Drupal\language_selection_page\LanguageSelectionPageConditionBase;
use Drupal\language_selection_page\LanguageSelectionPageConditionInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
final class LanguageSelectionPageConditionTitle extends LanguageSelectionPageConditionBase implements LanguageSelectionPageConditionInterface {
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form[$this
->getPluginId()] = [
'#type' => 'textfield',
'#default_value' => $this->configuration[$this
->getPluginId()],
'#description' => t('The title of the page.'),
'#required' => TRUE,
'#size' => 40,
];
return $form;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new self($configuration, $plugin_id, $plugin_definition);
}
public function evaluate() {
return $this
->pass();
}
}