Hi,
Im wondering about the parameters (param tag) in components xmls files.
My understanding is that these are provided for the user to set global options.
I am having trouble understanding these.
The following code renders the xml file fine, but doesn't change the parameter. I thought it would change the value in the xml file but it doesnt.
If someone could explain how to use the xml parameters I would be forever in debt
PHP Code:
global $mainframe,$database, $Itemid;
$option = 'com_simple_review';
// get params definitions
$menu =& new mosMenu( $database );
$menu->load( $Itemid );
$params =& new mosParameters( $menu->params,
$mainframe->getPath( 'com_xml', $option ), 'component' );
echo $params->render();
$params->set('sr_dateFormat', "hio");
PHP Code:
<params>
<param name="sr_allowAnonymousComments" type="radio" default="1" label="Allow Anonymouse Comments" description="Do you want anonymouse users to place comments?">
<option value="0">Hide</option>
<option value="1">Show</option>
</param>
<param name="sr_maxRating" type="list" default="5" label="Max Rating" description="The maximum rating a review can receive">
<option value="5">5</option>
<option value="10">10</option>
<option value="100">100</option>
<option value="100">100</option>
</param>
<param name="sr_dateFormat" type="text" size="25" default="%a %e %b %y" label="Date Format" description="Specify the date format, see http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html" />
</params>