Template::getLabel() method

Return template label for current language, or specified language if provided

If no template label, return template name. This is different from $template->label in that it knows about languages (when installed) and it will always return something. If there's no label, you'll still get the name.


// basic usage
$string = $template->getLabel();

// usage with all arguments
$string = $template->getLabel($language = null);


language (optional)Page, Language

Optional, if not used then user's current language is used

Return value


Template methods and properties

API reference based on ProcessWire core version 3.0.225

Latest news

  • ProcessWire Weekly #489
    In the 489th issue of ProcessWire Weekly we'll check out what's new in the core this week, share a brand-new recipe of the week, and more. Read on!
    Weekly.pw / 23 September 2023
  • ProcessWire 3.0.226 new main/master version
    After 8 months in development we are excited to bring you ProcessWire 3.0.226 main/master. This version has a ton of great new features, improvements and optimizations, plus more than 100 issue fixes. This post takes an in-depth look at highlights from this great new version.
    Blog / 25 August 2023
  • Subscribe to weekly ProcessWire news

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like superbude.de. ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH