Limitations on the use of #__ in external PHP scripts in Forms?

I am using external scripts in some forms to read and process PHP script files.

In the OnAfterProcess in the submission of a PHP script in the Form I am trying to use: (as an example)

$relationship = $formModel->getElementData('#__nestedsets___relationship');

but I have found that I can only use (for example)

$relationship = $formModel->getElementData('JM32_nestedsets___relationship');

The consequence is a loss of portability of the PHP script i.e. I would prefer to use #__ in place of the hard coded root of 'jm32'.

Am I missing something, or is there a tweak I have overlooked?

By the way, there is no problem if the script is used in the 'textarea' mode of application.

The problem only occurs in the use of an externally read php script.

Alastair
 
Many thanks for the link. The link seems to imply that the absolute table reference is required, rather than a relative table reference starting with #__.

Alastair
 
Yes, sorry I was meant to add that in with my reply. I'm not sure you actually need the #__

You can always grab the prefix if you want to include it in the code.

PHP:
$db = JFactory::getDBO();
$prefix = $db->getPrefix();
 
Back
Top