Actions

API15

PatTemplate Function Translate/call

From Joomla! Documentation

< API15:PatTemplate Function Translate
Revision as of 13:59, 12 May 2013 by JoomlaWikiBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

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

<CodeExamplesForm />