Best practice: $this->t() instead of t() when inside a class (OOP)

Created on 29 June 2019, about 6 years ago
Updated 15 February 2025, 7 months ago

Best practice depends on where the code is placed.

OOP Code

Use $this->t()

See 8 - Best practice: $this->t() versus t() - Drupal Answers

📌 Task
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

🇮🇹Italy lolandese Turin, Italy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024