API15:PatTemplate Function Translate/call
From Joomla! Documentation
Description
call the function
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
call($params, $content)
| Parameter Name | Default Value | Description |
|---|---|---|
| $params | parameters of the function (= attributes of the tag) | |
| $content | content of the tag |
Returns
string content to insert into the template Function modifed for Joomla!
Defined in
libraries/joomla/template/module/function/Translate.php
Importing
jimport( 'joomla.template.module.function.Translate' );
Source Body
function call( $params, $content )
{
$escape = isset( $params['escape'] ) ? $params['escape'] : '';
// just use the Joomla translation tool
if( count( $params ) > 0 && key_exists( 'key', $params ) ) {
$text = JText::_( $params['key'] );
} else {
$text = JText::_( $content );
}
if ($escape == 'yes' || $escape == 'true') {
$text = addslashes( $text );
}
return $text;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples