Closed (duplicate)
Project:
TableField
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Jun 2019 at 21:25 UTC
Updated:
15 Feb 2025 at 14:59 UTC
Jump to comment: Most recent
Best practice depends on where the code is placed.
OOP Code
Use $this->t()
See 8 - Best practice: $this->t() versus t() - Drupal Answers
Comments
Comment #2
sergiu stici commentedIn static function we can not use "$this" because object does not exist.
Comment #3
liam morlandI think these have all been fixed, such as by #2948324: Fix Drupal best practices in code. If not, please re-open and use an issue fork and merge request.