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 243 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

We
can get a reference to the JParameter object using the getParameters() method:
// get the user
$user =& JFactory::getUser();
// get the user's parameters object
$params =& $user->getParameters();
Chapter 7
[ 181 ]
Once we have the parameters object, we can load the XML file and render the form
elements using the render() method, as this example demonstrates:
$params->loadSetupFile($pathToXML_File);
echo $params->render('myparams');
A form field is created for each parameter, all of which are treated as a form array.
The parameter that we provide to the render() method is used to name the form
array. If we do not provide the parameter, the default name 'params' is used.
Our example will create two text inputs called myparams[myparameter] and
myparams[myotherparameter]. This is a screenshot of how these parameters
would appear:
Alternatively we could use the JParameter renderToArray() method
that returns an array of arrays that define the different form elements.
Creating a form to deal with extra parameters is only the beginning; we need to
process submitted forms.


Pages:
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6