Posted By

harikaram on 11/01/10


Tagged

forms xml joomla components jparameter


Versions (?)

Use JParameter to manually write a form field item


 / Published in: PHP
 

For instance when you want to leverage the JElements in a admin view form...

  1. $param = new JParameter('audioPath=/media/user/test.mp3');
  2. $xml = & JFactory::getXMLParser('Simple');
  3. $node = new JSimpleXMLElement( 'root', array());
  4. $node->addChild( 'param', array(
  5. 'type' => 'filelist',
  6. 'label'=>'Audio',
  7. 'name' => 'audioPath',
  8. 'default' => '',
  9. 'directory' => '/media/user/42daycourse',
  10. 'hide_default' => false,
  11. 'exclude' =>'(pdf|flv)'
  12. ));
  13. $param->setXml( $node );
  14. echo $param->render('formitemNamePrefix');

Report this snippet  

You need to login to post a comment.