diff -u b/form_example/form_example.routing.yml b/form_example/form_example.routing.yml --- b/form_example/form_example.routing.yml +++ b/form_example/form_example.routing.yml @@ -22,4 +22,5 @@ _form: '\Drupal\form_example\Form\SimpleForm' _title: 'Simple Form Example' +# TODO: Determine an appropriate right to check for this example. requirements: _access: 'TRUE' diff -u b/form_example/src/Controller/Page.php b/form_example/src/Controller/Page.php --- b/form_example/src/Controller/Page.php +++ b/form_example/src/Controller/Page.php @@ -2,7 +2,7 @@ /** * @file - * Implement simple page controller for simple pages. + * Contains Drupal\form_example\Controller\Page. */ namespace Drupal\form_example\Controller; @@ -18,12 +18,12 @@ */ public function description() { $content['intro'] = array( - '#markup' => t('

Form examples to demonstrate comment UI solutions using the Drupal Form API.

'), + '#markup' => '

' . $this->t('Form examples to demonstrate comment UI solutions using the Drupal Form API.') . '

', ); $content['links'] = array( '#theme' => 'item_list', '#items' => array( - $this->l(t('Simple Form'), new Url('form_example.simple_form')), + $this->l($this->t('Simple Form'), new Url('form_example.simple_form')), ), ); return $content; diff -u b/form_example/src/Form/SimpleForm.php b/form_example/src/Form/SimpleForm.php --- b/form_example/src/Form/SimpleForm.php +++ b/form_example/src/Form/SimpleForm.php @@ -1,7 +1,8 @@ 'textfield', - '#title' => t('Title'), + '#title' => $this->t('Title'), '#required' => TRUE, ); @@ -53,7 +54,7 @@ // Add a submit button that handles the submission of the form. $form['actions']['submit'] = array( '#type' => 'submit', - '#value' => t('Submit'), + '#value' => $this->t('Submit'), ); return $form;