SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 85 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

This example shows how we can parse INI data using the JParameter class:
$params = new JParameter($table->params);
Once we have a JParameter object we can access and modify the data in the object
using the get() and set() methods:
$value = $params->get('someValue');
$params->set('someValue', ++$value);
We can return the data to an INI string using the toString() method:
$table->params = $params->toString();
We can also use the JParameter class in conjunction with an XML metadata file to
define the values we might be holding in an INI string. This example shows how we
create a new JParameter object and load an XML metadata file; $path is the full path
to an XML manifest file:
$params = new JParameter('foo=bar', $pathToXML_File);
There is a full description explaining how to define an XML metadata file for these
purposes in Chapter 4 and the Appendix. We can use the render() method to output
form elements populated with the parameter values (how these are rendered is
defined in the XML file):
echo $params->render('params');
Date Fields
Different database servers use different date and time formats to store dates and
times.


Pages:
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97