API16

JParameter/render: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Render. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> {{Descrip...
 
m preparing for archive only
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
Render.
Render.


<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JParameter/render|Edit Descripton]]<nowiki>]</nowiki>
</span>


{{Description:JParameter/render}}
 
 


===Syntax===
===Syntax===
Line 68: Line 66:
</source>
</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JParameter/render|Edit See Also]]<nowiki>]</nowiki>
 
</span>
{{SeeAlso:JParameter/render}}


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=render
  category=render
  category=JParameter
  category=JParameter
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*
  format= ,,,
  format= ,,,
</dpl>
</dpl>

Latest revision as of 01:58, 25 March 2017

Description

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);
}



Examples

Code Examples