Get the Fabrik Form label with PHP Code?

ritesh123

Member
Hi All

I am trying to get the Fabrik Form Label with PHP code, but its not working

I tried this:-

$form = $this->form;
echo $form->label;

But the above code not working, i m getting this

Notice: Undefined property: PlgFabrik_FormPHP::$form in

Notice: Trying to get property of non-object in
 
Hi

I tried my self and its working now, i tried to get it directly from Database after reading the Fabrik URL

Here i am giving it for everyone, who may need it in future

$db =&JFactory::getDBO();

$formid = JRequest::getInt('formid');
$rowid = JRequest::getVar('rowid');


$result = mysql_query("SELECT label FROM xxx_fabrik_forms where id='$formid'");

while ($row = mysql_fetch_assoc($result))
{
$formlabel=$row['label'] ;
}

echo $formlabel;
 
It could probably be done a lot simpler than that, if we knew "where" you are trying to do this, as per Troester's question.

A little more explanation of what you are trying to do, and where you are doing it, would help.

-- hugh
 
Well that is most informative - NOT!!! :)

How about c&p your code from script.php?

Also, interested to know why you are using a custom component and not more standard fabrik plugins - and wondering what issues there might be accessing fabrik from other components rather than from e.g. php plugins.
 

Members online

No members online now.
Back
Top