API16

JText/sprintf

From Joomla! Documentation

< API16:JText
Revision as of 17:54, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Passes a string thru an sprintf. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The "API16" 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]

Passes a string thru an sprintf.

[Edit Descripton]

Template:Description:JText/sprintf

Syntax[edit]

static sprintf($string)
Parameter Name Default Value Description
$string The format string.

Defined in[edit]

libraries/joomla/methods.php

Importing[edit]

jimport( 'joomla.methods' );

Source Body[edit]

public static function sprintf($string)
{
        $lang = &JFactory::getLanguage();
        $args = func_get_args();
        if (count($args) > 0)
        {
                $args[0] = $lang->_($args[0]);
                return call_user_func_array('sprintf', $args);
        }
        return '';
}

[Edit See Also] Template:SeeAlso:JText/sprintf

Examples[edit]

<CodeExamplesForm />