Skip to content
Snippets Groups Projects
Select Git revision
  • 6d717e1a5a5dd592ebbeaafad11746849fb52532
  • 8.3.x default
  • 3433266-drupal.whitespace.scopeclosingbrace.indent-detects-indentation
  • 8.x-3.x
  • 8.x-2.x
  • 7.x-1.x
  • 7.x-2.x
  • 6.x-2.x
  • 5.x-2.x
  • 6.x-1.x
  • 4.7.x-1.x
  • 4.7.x-2.x
  • 5.x-1.x
  • 8.3.23
  • 8.3.22
  • 8.3.21
  • 8.3.20
  • 8.3.19
  • 8.3.18
  • 8.3.17
  • 8.3.16
  • 8.3.15
  • 8.3.14
  • 8.3.13
  • 8.3.12
  • 8.3.11
  • 8.3.10
  • 8.3.9
  • 8.3.8
  • 8.x-3.8
  • 8.3.7
  • 8.x-3.7
  • 8.3.6
33 results

GlobalFunctionUnitTest.inc

Blame
  • Forked from project / coder
    417 commits behind the upstream repository.
    Klaus Purer's avatar
    Isssue #2720343: Allow global t() and \Drupal calls in static methods
    Klaus Purer authored
    6d717e1a
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    GlobalFunctionUnitTest.inc 304 B
    <?php
    
    class TestForm extends FormBase {
    
      public function buildForm($form, $form_state) {
        $form['something'] = t('Example text');
        $form['another'] = $this->t('test');
      }
    
      public static function example() {
        // t() calls are allowed in static methods.
        return t('Example text');
      }
    
    }