Load a file from a xml string ?
Posted: Mon Apr 23, 2012 8:21 pm
Hi,
In order to add some customized fields in the user form I builded
a profile plugin as described here
http://docs.joomla.org/Creating_a_profile_plugin
So in the onContentPrepareForm function, When I load my form from the xml file (profiles/profile.xml) it works right.
but for some reasons I'd need to build some part of the form on the fly so
I tried to store the content of the xml file in a php variable:
then load it:
but the form is not loaded at all.
Can someone tells me where the problem comes from ?
Thanks
In order to add some customized fields in the user form I builded
a profile plugin as described here
http://docs.joomla.org/Creating_a_profile_plugin
So in the onContentPrepareForm function, When I load my form from the xml file (profiles/profile.xml) it works right.
Code: Select all
JForm::addFormPath(dirname(__FILE__).'/profiles');
$form->loadFile('profile', false);
I tried to store the content of the xml file in a php variable:
Code: Select all
$myprofile = '<?xml version="1.0" encoding="utf-8"?>
<form>
<fields name="myprofile">
<fieldset name="myprofile"
label="PLG_USER_MY_PROFILE_SLIDER_LABEL" >
...
</form>';
Code: Select all
$form->loadFile($myprofile, false);
Can someone tells me where the problem comes from ?
Thanks