class SignupForm in SendinBlue 8
Same name and namespace in other branches
- 8.2 src/Form/SignupForm.php \Drupal\sendinblue\Form\SignupForm
Form controller for the content_entity_example entity edit forms.
Hierarchy
- class \Drupal\Core\Form\FormBase implements ContainerInjectionInterface, FormInterface uses DependencySerializationTrait, LoggerChannelTrait, MessengerTrait, LinkGeneratorTrait, RedirectDestinationTrait, UrlGeneratorTrait, StringTranslationTrait
- class \Drupal\Core\Entity\EntityForm implements EntityFormInterface
- class \Drupal\Core\Entity\ContentEntityForm implements ContentEntityFormInterface
- class \Drupal\sendinblue\Form\SignupForm
- class \Drupal\Core\Entity\ContentEntityForm implements ContentEntityFormInterface
- class \Drupal\Core\Entity\EntityForm implements EntityFormInterface
Expanded class hierarchy of SignupForm
File
- src/
Form/ SignupForm.php, line 23
Namespace
Drupal\sendinblue\FormView source
class SignupForm extends ContentEntityForm {
/**
* RouteBuilderInterface.
*
* @var \Drupal\Core\Routing\RouteBuilderInterface
*/
private $routeBuilder;
/**
* SendinblueManager.
*
* @var \Drupal\sendinblue\SendinblueManager
*/
private $sendinblueManager;
/**
* {@inheritdoc}
*/
public function __construct(EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info, TimeInterface $time, MessengerInterface $messenger, RouteBuilderInterface $routeBuilder, SendinblueManager $sendinblueManager) {
parent::__construct($entity_repository, $entity_type_bundle_info, $time);
$this->sendinblueManager = $sendinblueManager;
$this->messenger = $messenger;
$this->routeBuilder = $routeBuilder;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('entity.repository'), $container
->get('entity_type.bundle.info'), $container
->get('datetime.time'), $container
->get('messenger'), $container
->get('router.builder'), $container
->get('sendinblue.manager'));
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
/* @var $entity Signup */
$form = parent::buildForm($form, $form_state);
$signup = $this->entity;
$settings = !$signup->settings
->first() ? [] : $signup->settings
->first()
->getValue();
$form_state
->set('signup', $signup);
// Form Field for organization.
$form['#attributes'] = [
'class' => [
'container-fluid',
],
'id' => 'wrap',
];
$form['wrap_left'] = [
'#prefix' => '<div id="wrap-left" class="col-md-9">',
'#suffix' => '</div>',
];
$form['wrap_left']['form'] = [
'#type' => 'fieldset',
'#title' => $this
->t('Form'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
];
$form['wrap_left']['form']['title'] = [
'#type' => 'textfield',
'#title' => $this
->t('Title'),
'#description' => $this
->t('The title for this signup form.'),
'#size' => 35,
'#maxlength' => 32,
'#default_value' => $signup->title->value,
'#required' => TRUE,
'#attributes' => [
'style' => 'width:200px;',
],
];
// Machine-readable list name.
$status = isset($signup->status->value) && $signup->mcsId->value && ($signup->status->value || $signup->status->value);
$form['wrap_left']['form']['name'] = [
'#type' => 'machine_name',
'#default_value' => $signup->name->value,
'#maxlength' => 32,
'#disabled' => $status,
'#description' => $this
->t('A unique machine-readable name for this list. It must only contain lowercase letters, numbers, and underscores.'),
'#attributes' => [
'style' => 'width:200px;',
],
];
$form['wrap_left']['form']['description'] = [
'#type' => 'text_format',
'#title' => $this
->t('Description'),
'#default_value' => isset($settings['description']['value']) ? $settings['description']['value'] : '',
'#rows' => 2,
'#maxlength' => 500,
'#description' => $this
->t('This description will be shown on the signup form below the title. (500 characters or less)'),
];
if (isset($settings['description']['format'])) {
$form['wrap_left']['form']['description']['#format'] = $settings['description']['format'];
}
$mode_defaults = [
SendinblueManager::SENDINBLUE_SIGNUP_BLOCK => [
SendinblueManager::SENDINBLUE_SIGNUP_BLOCK,
],
SendinblueManager::SENDINBLUE_SIGNUP_PAGE => [
SendinblueManager::SENDINBLUE_SIGNUP_PAGE,
],
SendinblueManager::SENDINBLUE_SIGNUP_BOTH => [
SendinblueManager::SENDINBLUE_SIGNUP_BLOCK,
SendinblueManager::SENDINBLUE_SIGNUP_PAGE,
],
];
$form['wrap_left']['form']['mode'] = [
'#type' => 'checkboxes',
'#title' => $this
->t('Display Mode') . $signup->mode->value,
'#required' => TRUE,
'#options' => [
SendinblueManager::SENDINBLUE_SIGNUP_BLOCK => $this
->t('Block'),
SendinblueManager::SENDINBLUE_SIGNUP_PAGE => $this
->t('Page'),
],
'#default_value' => !empty($signup->mode->value) ? $mode_defaults[$signup->mode->value] : [],
];
$form['wrap_left']['form']['path'] = [
'#type' => 'textfield',
'#title' => $this
->t('Page URL'),
'#description' => $this
->t('Path to the signup page. ie "newsletter/signup".'),
'#default_value' => isset($settings['path']) ? $settings['path'] : NULL,
'#states' => [
// Hide unless needed.
'visible' => [
':input[name="mode[' . SendinblueManager::SENDINBLUE_SIGNUP_PAGE . ']"]' => [
'checked' => TRUE,
],
],
'required' => [
':input[name="mode[' . SendinblueManager::SENDINBLUE_SIGNUP_PAGE . ']"]' => [
'checked' => TRUE,
],
],
],
'#attributes' => [
'style' => 'width:400px;',
],
];
// Fields for organization.
$form['wrap_left']['fields'] = [
'#type' => 'fieldset',
'#title' => $this
->t('Fields'),
'#tree' => TRUE,
'#collapsible' => TRUE,
'#collapsed' => FALSE,
];
$attributes = $this->sendinblueManager
->getAttributeLists();
$form['wrap_left']['fields']['mergefields']['EMAIL']['check'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Email'),
'#default_value' => TRUE,
'#disabled' => TRUE,
];
$form['wrap_left']['fields']['mergefields']['EMAIL']['label'] = [
'#type' => 'textfield',
'#title' => $this
->t('Label'),
'#tree' => TRUE,
'#default_value' => isset($settings['fields']['mergefields']['EMAIL']['label']) ? $settings['fields']['mergefields']['EMAIL']['label'] : $this
->t('Email'),
'#required' => TRUE,
'#attributes' => [
'style' => 'width:200px;',
],
'#prefix' => '<div class="sendinblue_sub_field">',
'#suffix' => '</div>',
];
$form['wrap_left']['fields']['mergefields']['EMAIL']['required'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Required?'),
'#tree' => TRUE,
'#default_value' => TRUE,
'#disabled' => TRUE,
'#prefix' => '<div class="sendinblue_sub_field">',
'#suffix' => '</div>',
];
foreach ($attributes as $attribute) {
$settings_attribute = $settings['fields']['mergefields'][$attribute
->getName()] ?? NULL;
$form['wrap_left']['fields']['mergefields'][$attribute
->getName()]['check'] = [
'#type' => 'checkbox',
'#title' => $attribute
->getName(),
'#default_value' => isset($settings_attribute['check']) ? $settings_attribute['check'] : FALSE,
];
$form['wrap_left']['fields']['mergefields'][$attribute
->getName()]['label'] = [
'#type' => 'textfield',
'#title' => $this
->t('Label'),
'#tree' => TRUE,
'#default_value' => isset($settings_attribute['label']) ? $settings_attribute['label'] : $attribute
->getName(),
'#required' => TRUE,
'#states' => [
// Hide unless needed.
'visible' => [
':input[name="fields[mergefields][' . $attribute
->getName() . '][check]"]' => [
'checked' => TRUE,
],
],
'required' => [
':input[name="mode[' . $attribute
->getName() . '][check]"]' => [
'checked' => TRUE,
],
],
],
'#attributes' => [
'style' => 'width:200px;',
],
'#prefix' => '<div class="sendinblue_sub_field">',
'#suffix' => '</div>',
];
$form['wrap_left']['fields']['mergefields'][$attribute
->getName()]['required'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Required?'),
'#tree' => TRUE,
'#default_value' => isset($settings['fields']['mergefields'][$attribute
->getName()]['required']) ? $settings_attribute['required'] : FALSE,
'#states' => [
// Hide unless needed.
'visible' => [
':input[name="fields[mergefields][' . $attribute
->getName() . '][check]"]' => [
'checked' => TRUE,
],
],
'required' => [
':input[name="mode[' . $attribute
->getName() . '][check]"]' => [
'checked' => TRUE,
],
],
],
'#prefix' => '<div class="sendinblue_sub_field">',
'#suffix' => '</div>',
];
}
$form['wrap_left']['fields']['submit_button'] = [
'#type' => 'textfield',
'#title' => $this
->t('Submit Button Label'),
'#required' => 'TRUE',
'#default_value' => isset($settings['fields']['submit_button']) ? $settings['fields']['submit_button'] : $this
->t('Submit'),
'#attributes' => [
'style' => 'width:200px;',
],
'#tree' => TRUE,
];
// Fields Field for organization.
$form['wrap_left']['subscription'] = [
'#type' => 'fieldset',
'#title' => $this
->t('Subscription'),
'#tree' => TRUE,
'#collapsible' => TRUE,
'#collapsed' => FALSE,
];
$form['wrap_left']['subscription']['settings'] = [
'#type' => 'fieldset',
'#title' => $this
->t('Settings'),
'#tree' => TRUE,
'#collapsible' => TRUE,
'#collapsed' => FALSE,
];
$sendinblue_lists = $this->sendinblueManager
->getLists();
$options = [];
foreach ($sendinblue_lists as $mc_list) {
$options[$mc_list['id']] = $mc_list['name'];
}
$form['wrap_left']['subscription']['settings']['list'] = [
'#type' => 'select',
'#title' => $this
->t('List where subscribers are saved'),
'#options' => $options,
'#default_value' => isset($settings['subscription']['settings']['list']) ? $settings['subscription']['settings']['list'] : '',
'#description' => $this
->t('Select the list where you want to add your new subscribers'),
'#attributes' => [
'style' => 'width:200px;',
],
];
$form['wrap_left']['subscription']['settings']['redirect_url'] = [
'#type' => 'textfield',
'#title' => $this
->t('URL redirection'),
'#required' => FALSE,
'#default_value' => isset($settings['subscription']['settings']['redirect_url']) ? $settings['subscription']['settings']['redirect_url'] : '',
'#description' => $this
->t('Redirect to this URL after subscription'),
'#attributes' => [
'style' => 'width:400px;',
],
];
$form['wrap_left']['subscription']['settings']['email_confirmation'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Email confirmation'),
'#required' => FALSE,
'#default_value' => isset($settings['subscription']['settings']['email_confirmation']) ? $settings['subscription']['settings']['email_confirmation'] : '',
'#description' => $this
->t('You can choose to send a confirmation email. You will be able to set up the template & sender that will be sent to your new subscribers'),
];
$sendinblue_templates = $this->sendinblueManager
->getTemplateList();
$options = [];
if ($sendinblue_templates) {
foreach ($sendinblue_templates
->getTemplates() as $mc_template) {
$options[$mc_template
->getId()] = $mc_template
->getName();
}
}
$form['wrap_left']['subscription']['settings']['template'] = [
'#type' => 'select',
'#title' => $this
->t('Select Template'),
'#options' => $options,
'#default_value' => isset($settings['subscription']['settings']['template']) ? $settings['subscription']['settings']['template'] : '-1',
'#description' => $this
->t('Select the template that will be sent to your new subscribers. You can create new template at @SendinBlue.', [
'@SendinBlue' => Link::fromTextAndUrl($this
->t('SendinBlue'), Url::fromUri('https://my.sendinblue.com/camp/listing/?utm_source=drupal_plugin&utm_medium=plugin&utm_campaign=module_link#temp_active_m'))
->toString(),
]),
'#states' => [
// Hide unless needed.
'visible' => [
':input[name="subscription[settings][email_confirmation]"]' => [
'checked' => TRUE,
],
],
'required' => [
':input[name="subscription[settings][email_confirmation]"]' => [
'checked' => TRUE,
],
],
],
'#attributes' => [
'style' => 'width:200px;',
],
];
$form['wrap_left']['subscription']['messages'] = [
'#type' => 'fieldset',
'#title' => $this
->t('Messages'),
'#tree' => TRUE,
'#collapsible' => TRUE,
'#collapsed' => FALSE,
];
$form['wrap_left']['subscription']['messages']['success'] = [
'#type' => 'textfield',
'#title' => $this
->t('Success message'),
'#required' => FALSE,
'#default_value' => isset($settings['subscription']['messages']['success']) ? $settings['subscription']['messages']['success'] : $this
->t('Thank you, you have successfully registered!'),
'#description' => $this
->t('Set up the success message that will appear when one of your visitors successfully signs up'),
'#attributes' => [
'style' => 'width:400px;',
],
];
$form['wrap_left']['subscription']['messages']['general'] = [
'#type' => 'textfield',
'#title' => $this
->t('General error message'),
'#required' => FALSE,
'#default_value' => isset($settings['subscription']['messages']['general']) ? $settings['subscription']['messages']['general'] : $this
->t('Something wrong occured'),
'#description' => $this
->t('Set up the message that will appear when an error occurs during the subscription process'),
'#attributes' => [
'style' => 'width:400px;',
],
];
$form['wrap_left']['subscription']['messages']['existing'] = [
'#type' => 'textfield',
'#title' => $this
->t('Existing subscribers'),
'#required' => FALSE,
'#default_value' => isset($settings['subscription']['messages']['existing']) ? $settings['subscription']['messages']['existing'] : 'You have already registered',
'#description' => $this
->t('Set up the message that will appear when a subscriber is already in your database'),
'#attributes' => [
'style' => 'width:400px;',
],
];
$form['wrap_left']['subscription']['messages']['invalid'] = [
'#type' => 'textfield',
'#title' => $this
->t('Existing subscribers'),
'#required' => FALSE,
'#default_value' => isset($settings['subscription']['messages']['invalid']) ? $settings['subscription']['messages']['invalid'] : 'Your email address is invalid',
'#description' => $this
->t('Set up the message that will appear when the email address used to sign up is not valid'),
'#attributes' => [
'style' => 'width:400px;',
],
];
// $markup = SendinblueManager::generateSidebar();
$form['wrap_right'] = [
'#type' => 'markup',
'#prefix' => '<div id="wrap-right-side" class="col-md-3">',
// '#markup' => $markup,.
'#suffix' => '</div><div class="clearfix"></div>',
'#tree' => TRUE,
];
return $form;
}
/**
* {@inheritdoc}
*
* Button-level validation handlers are highly discouraged for entity forms,
* as they will prevent entity validation from running. If the entity is going
* to be saved during the form submission, this method should be manually
* invoked from the button-level validation handler, otherwise an exception
* will be thrown.
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
parent::validateForm($form, $form_state);
/** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
$entity = $this
->buildEntity($form, $form_state);
$path = $form_state
->getValue([
'path',
]);
$redirect_url = $form_state
->getValue([
'subscription',
'settings',
'redirect_url',
]);
if (!empty($path) && UrlHelper::isExternal($path)) {
$form_state
->setErrorByName('path', 'The path "' . $path . '" for Display Mode is invalid. You have to put a valid internal path.');
return;
}
if (!empty($redirect_url) && UrlHelper::isExternal($redirect_url)) {
$form_state
->setErrorByName('redirect_url', 'The redirect_url "' . $redirect_url . '" for SUBSCRIPTION is invalid. You have to put a valid internal path.');
return;
}
return $entity;
}
/**
* Form submission handler.
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
if (!$form_state
->getValue([
'mode',
SendinblueManager::SENDINBLUE_SIGNUP_PAGE,
])) {
$form_state
->setValue([
'path',
], '');
}
$signup_mode = array_sum($form_state
->getValue([
'mode',
]));
$signup_path = $form_state
->getValue([
'path',
]);
$form_state
->setValue([
'mode',
], $signup_mode);
$this->entity->title = $form_state
->getValue([
'title',
]);
$this->entity->name = $form_state
->getValue([
'name',
]);
$this->entity->mode = $signup_mode;
$this->entity->settings = [
'description' => $form_state
->getValue([
'description',
]),
'path' => $signup_path,
'fields' => $form_state
->getValue([
'fields',
]),
'subscription' => $form_state
->getValue([
'subscription',
]),
];
$this->messenger
->addStatus($this
->t('Signup form @name has been saved.', [
'@name' => $form_state
->getValue([
'title',
]),
]));
if (isset($signup_path)) {
// We have a new (or removed) path. Rebuild menus.
$this->routeBuilder
->rebuild();
}
$form_state
->setRedirect('admin/config/system/sendinblue/signup');
parent::submitForm($form, $form_state);
}
/**
* {@inheritdoc}
*/
public function save(array $form, FormStateInterface $form_state) {
$form_state
->setRedirect('entity.sendinblue_signup_form.collection');
$entity = $this
->getEntity();
$entity
->save();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContentEntityForm:: |
protected | property |
The entity being used by this form. Overrides EntityForm:: |
9 |
ContentEntityForm:: |
protected | property | The entity repository service. | |
ContentEntityForm:: |
protected | property | The entity type bundle info service. | |
ContentEntityForm:: |
protected | property | The time service. | |
ContentEntityForm:: |
protected | function | Add revision form fields if the entity enabled the UI. | |
ContentEntityForm:: |
public | function |
Builds an updated entity object based upon the submitted form values. Overrides EntityForm:: |
3 |
ContentEntityForm:: |
protected | function |
Copies top-level form values to entity properties Overrides EntityForm:: |
|
ContentEntityForm:: |
protected | function | Flags violations for the current form. | 4 |
ContentEntityForm:: |
public | function |
Gets the actual form array to be built. Overrides EntityForm:: |
13 |
ContentEntityForm:: |
protected | function | Returns the bundle entity of the entity, or NULL if there is none. | |
ContentEntityForm:: |
protected | function | Gets the names of all fields edited in the form. | 4 |
ContentEntityForm:: |
public | function |
Gets the form display. Overrides ContentEntityFormInterface:: |
|
ContentEntityForm:: |
public | function |
Gets the code identifying the active form language. Overrides ContentEntityFormInterface:: |
|
ContentEntityForm:: |
protected | function | Should new revisions created on default. | |
ContentEntityForm:: |
protected | function |
Initializes the form state and the entity before the first form build. Overrides EntityForm:: |
1 |
ContentEntityForm:: |
protected | function | Initializes form language code values. | |
ContentEntityForm:: |
public | function |
Checks whether the current form language matches the entity one. Overrides ContentEntityFormInterface:: |
|
ContentEntityForm:: |
protected | function |
Prepares the entity object before the form is built first. Overrides EntityForm:: |
1 |
ContentEntityForm:: |
public | function |
Sets the form display. Overrides ContentEntityFormInterface:: |
|
ContentEntityForm:: |
protected | function | Checks whether the revision form fields should be added to the form. | |
ContentEntityForm:: |
public | function | Updates the changed time of the entity. | |
ContentEntityForm:: |
public | function | Updates the form language to reflect any change to the entity language. | |
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
EntityForm:: |
protected | property | The entity type manager. | 3 |
EntityForm:: |
protected | property | The module handler service. | |
EntityForm:: |
protected | property | The name of the current operation. | |
EntityForm:: |
private | property | The entity manager. | |
EntityForm:: |
protected | function | Returns an array of supported actions for the current entity form. | 29 |
EntityForm:: |
protected | function | Returns the action form element for the current entity form. | |
EntityForm:: |
public | function | Form element #after_build callback: Updates the entity with submitted data. | |
EntityForm:: |
public | function |
Returns a string identifying the base form. Overrides BaseFormIdInterface:: |
5 |
EntityForm:: |
public | function |
Gets the form entity. Overrides EntityFormInterface:: |
|
EntityForm:: |
public | function |
Determines which entity will be used by this form from a RouteMatch object. Overrides EntityFormInterface:: |
1 |
EntityForm:: |
public | function |
Returns a unique string identifying the form. Overrides FormInterface:: |
10 |
EntityForm:: |
public | function |
Gets the operation identifying the form. Overrides EntityFormInterface:: |
|
EntityForm:: |
protected | function | Invokes the specified prepare hook variant. | |
EntityForm:: |
public | function | Process callback: assigns weights and hides extra fields. | |
EntityForm:: |
public | function |
Sets the form entity. Overrides EntityFormInterface:: |
|
EntityForm:: |
public | function |
Sets the entity manager for this form. Overrides EntityFormInterface:: |
|
EntityForm:: |
public | function |
Sets the entity type manager for this form. Overrides EntityFormInterface:: |
|
EntityForm:: |
public | function |
Sets the module handler for this form. Overrides EntityFormInterface:: |
|
EntityForm:: |
public | function |
Sets the operation for this form. Overrides EntityFormInterface:: |
|
EntityForm:: |
public | function | ||
EntityForm:: |
public | function | ||
FormBase:: |
protected | property | The config factory. | 1 |
FormBase:: |
protected | property | The request stack. | 1 |
FormBase:: |
protected | property | The route match. | |
FormBase:: |
protected | function | Retrieves a configuration object. | |
FormBase:: |
protected | function | Gets the config factory for this form. | 1 |
FormBase:: |
private | function | Returns the service container. | |
FormBase:: |
protected | function | Gets the current user. | |
FormBase:: |
protected | function | Gets the request object. | |
FormBase:: |
protected | function | Gets the route match. | |
FormBase:: |
protected | function | Gets the logger for a specific channel. | |
FormBase:: |
protected | function |
Returns a redirect response object for the specified route. Overrides UrlGeneratorTrait:: |
|
FormBase:: |
public | function | Resets the configuration factory. | |
FormBase:: |
public | function | Sets the config factory for this form. | |
FormBase:: |
public | function | Sets the request stack object to use. | |
LinkGeneratorTrait:: |
protected | property | The link generator. | 1 |
LinkGeneratorTrait:: |
protected | function | Returns the link generator. | |
LinkGeneratorTrait:: |
protected | function | Renders a link to a route given a route name and its parameters. | |
LinkGeneratorTrait:: |
public | function | Sets the link generator service. | |
LoggerChannelTrait:: |
protected | property | The logger channel factory service. | |
LoggerChannelTrait:: |
protected | function | Gets the logger for a specific channel. | |
LoggerChannelTrait:: |
public | function | Injects the logger channel factory. | |
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
RedirectDestinationTrait:: |
protected | property | The redirect destination service. | 1 |
RedirectDestinationTrait:: |
protected | function | Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url. | |
RedirectDestinationTrait:: |
protected | function | Returns the redirect destination service. | |
RedirectDestinationTrait:: |
public | function | Sets the redirect destination service. | |
SignupForm:: |
private | property | RouteBuilderInterface. | |
SignupForm:: |
private | property | SendinblueManager. | |
SignupForm:: |
public | function |
Form constructor. Overrides EntityForm:: |
|
SignupForm:: |
public static | function |
Instantiates a new instance of this class. Overrides ContentEntityForm:: |
|
SignupForm:: |
public | function |
Form submission handler for the 'save' action. Overrides EntityForm:: |
|
SignupForm:: |
public | function |
Form submission handler. Overrides ContentEntityForm:: |
|
SignupForm:: |
public | function |
Button-level validation handlers are highly discouraged for entity forms,
as they will prevent entity validation from running. If the entity is going
to be saved during the form submission, this method should be manually
invoked from the button-level… Overrides ContentEntityForm:: |
|
SignupForm:: |
public | function |
Constructs a ContentEntityForm object. Overrides ContentEntityForm:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
UrlGeneratorTrait:: |
protected | property | The url generator. | |
UrlGeneratorTrait:: |
protected | function | Returns the URL generator service. | |
UrlGeneratorTrait:: |
public | function | Sets the URL generator service. | |
UrlGeneratorTrait:: |
protected | function | Generates a URL or path for a specific route based on the given parameters. |