User Tools

Site Tools


Table of Contents


The t ViewHelper is used for loading and fetching of translation strings.

→ Since BIGACE 3.0


  • $key - (optional, string)

The $key defines the name of the translation.

  • $default - (optional, string)

The $default string to return if $key could not be found. (Default: '' in which case '???'.$key.'???' will be returned)

Function load():

  • $name - (required, string)

The $name defines the filename to load.

  • $locale - (optional, string)

The $locale in which the translation file is loaded.


This example shows to fetch a translated String with the key 'search'.

  echo $this->t('search');

This example shows to use a default string if the requested translation does not exist.

  echo $this->t('not-existing', 'i will be echoed!');

This example shows how to load a translation file.

  // loads the file 'bigace' in the current session language
  // loads the file in english
  $this->t()->load('bigace', 'en');

See also

bigace/developer/viewhelper/t.txt · Last modified: 2011/02/22 17:41 by kevin