Skip to content
Snippets Groups Projects
Commit 39d1a064 authored by Roger Codina's avatar Roger Codina
Browse files

Fix phpcs

parent 9a66d613
No related branches found
No related tags found
1 merge request!83Issue #1615520: Add translatable config_simple_example
<?php
namespace Drupal\config_simple_example\Form;
use Drupal\Core\Form\ConfigFormBase;
......@@ -8,6 +9,7 @@
* Configure example settings for this site.
*/
class ConfigSimpleExampleSettingsForm extends ConfigFormBase {
/**
* {@inheritdoc}
*/
......@@ -30,11 +32,11 @@ protected function getEditableConfigNames() {
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this->config('config_simple_example.settings');
$form['message'] = array(
$form['message'] = [
'#type' => 'textarea',
'#title' => $this->t('Message'),
'#default_value' => $config->get('message'),
);
];
return parent::buildForm($form, $form_state);
}
......@@ -43,12 +45,13 @@ public function buildForm(array $form, FormStateInterface $form_state) {
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
// Retrieve the configuration
// Retrieve the configuration.
$this->config('config_simple_example.settings')
// Set the submitted configuration setting
// Set the submitted configuration setting.
->set('message', $form_state->getValue('message'))
->save();
parent::submitForm($form, $form_state);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment