Class patTemplate_Function_Translate

Description

patTemplate function that emulates gettext's behaviour

This can be used to create multi-lingual websites. When the template is read, all texts inside the Translation tags are extracted and written to a file called '$tmplname-default.ini'.

You should copy this file and translate all sentences. When the template is used the next time, the sentences will be replaced with their respective translations, according to the langanuge you set with:

  1. $tmpl->setOption( 'lang', 'de' );

$Id: Translate.php,v 1.6 2004/10/27 11:22:37 schst Exp $

  • todo: add error management
  • author: Stephan Schmidt <schst@php.net>

Located in /includes/patTemplate/patTemplate/Function/Translate.php (line 48)

patTemplate_Module
   |
   --patTemplate_Function
      |
      --patTemplate_Function_Translate
Variable Summary
object $_tmpl
Method Summary
string call (array $params, string $content)
Variables
object $_tmpl (line 95)

reference to the patTemplate object that instantiated the module

  • access: protected

Inherited Variables

Inherited from patTemplate_Function

patTemplate_Function::$type

Inherited from patTemplate_Module

patTemplate_Module::$_params
Methods
call (line 116)

call the function

  • return: content to insert into the template
  • access: public
string call (array $params, string $content)
  • array $params: parameters of the function (= attributes of the tag)
  • string $content: content of the tag

Redefinition of:
patTemplate_Function::call()
call the function
setTemplateReference (line 103)

set a reference to the patTemplate object that instantiated the reader

  • access: public
void setTemplateReference (object patTemplate &$tmpl)

Inherited Methods

Inherited From patTemplate_Function

patTemplate_Function::call()
patTemplate_Function::setReader()

Inherited From patTemplate_Module

patTemplate_Module::getName()
patTemplate_Module::getParam()
patTemplate_Module::setParams()

Documentation generated on Fri, 4 Mar 2005 13:57:26 +1000 by phpDocumentor 1.3.0RC3