PatTemplate Function Translate/call
From Joomla! Documentation
< API15:PatTemplate Function TranslateRevision as of 17:24, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description===
call the function
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</n...)
Revision as of 17:24, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description===
call the function
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</n...)
The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
call the function
Template:Description:patTemplate Function Translate/call
Syntax[edit]
call($params, $content)
Parameter Name | Default Value | Description |
---|---|---|
$params | parameters of the function (= attributes of the tag) | |
$content | content of the tag |
Returns[edit]
string content to insert into the template Function modifed for Joomla!
Defined in[edit]
libraries/joomla/template/module/function/Translate.php
Importing[edit]
jimport( 'joomla.template.module.function.Translate' );
Source Body[edit]
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;
}
[Edit See Also] Template:SeeAlso:patTemplate Function Translate/call
Examples[edit]
<CodeExamplesForm />