Actions

API16

JParameter/render

From Joomla! Documentation

< API16:JParameter
Revision as of 17:52, 22 March 2010 by Doxiki (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

Render.

[Edit Descripton]

Description:JParameter/render

Syntax

render($name= 'params', $group= '_default')
Parameter Name Default Value Description
$name 'params' The name of the control, or the default text area if a setup file is not found.
$group '_default'

Returns

string HTML

Defined in

libraries/joomla/html/parameter.php

Importing

jimport( 'joomla.html.parameter' );

Source Body

public function render($name = 'params', $group = '_default')
{
        if (!isset($this->_xml[$group])) {
                return false;
        }
 
        $params = $this->getParams($name, $group);
        $html = array ();
 
        if ($description = $this->_xml[$group]->attributes('description')) {
                // add the params description to the display
                $desc   = JText::_($description);
                $html[] = '<p class="paramrow_desc">'.$desc.'</p>';
        }
 
        foreach ($params as $param) {
                if ($param[0]) {
                        $html[] = $param[0];
                        $html[] = $param[1];
                } else {
                        $html[] = $param[1];
                }
        }
 
        if (count($params) < 1) {
                $html[] = "<p class=\"noparams\">".JText::_('THERE_ARE_NO_PARAMETERS_FOR_THIS_ITEM')."</p>";
        }
 
        return implode(PHP_EOL, $html);
}

[Edit See Also] SeeAlso:JParameter/render

Examples

<CodeExamplesForm />