The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Apr 23, 2012 8:21 pm 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun Jul 12, 2009 12:04 pm
Posts: 204
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.
Code:
JForm::addFormPath(dirname(__FILE__).'/profiles');
    $form->loadFile('profile', false);

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:
Code:
$myprofile = '<?xml version="1.0" encoding="utf-8"?>
                 <form>
               <fields name="myprofile">
                 <fieldset name="myprofile"
                    label="PLG_USER_MY_PROFILE_SLIDER_LABEL" >

                      ...
         
                  </form>';

then load it:
Code:
$form->loadFile($myprofile, false);

but the form is not loaded at all.

Can someone tells me where the problem comes from ?


Thanks


Top
 Profile  
 
PostPosted: Tue Apr 24, 2012 11:14 am 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun Jul 12, 2009 12:04 pm
Posts: 204
I got it.
Finally the solution was simple.
Just using load function instead loadFile.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 



Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group