0
votes

I have created new module, which populate information from database. this information will be displayed inside the grid. when the specific record is click light popup will be display.new PHP file is (showdetails.php) assigned to light box.

<td><a class="modal" href="showdetails.php" rel="{handler: 'iframe', size: {x: 680, y: 370}}" >POPUP</a></td>

POPup working fine. but inside popup, i am not getting " Not Found " error.

What is the rule to follow for popup or external file access.

showdetails.php contain below code

defined('_JEXEC') or die; echo "Hello world";

1

1 Answers

3
votes

If the showdetails.php file is not loaded using the Joomla framework, then the constant _JEXEC is not defined and your script will die.

So don't use defined('_JEXEC') or die; and try again.

If it still fails, make sure to reference the file correctly.

Edit: According to your comments I think you got a bigger problem here. If you want to use Joomla functions within your showdetails.php, you would have to initialise the whole Joomla framework first, otherwise db and such things will not be available. Usually such a popup loads a component view using an URL like index.php?option=com_mycomponent&view=myview&layout=popup&tmpl=component. This way the Joomla framework is loaded and you have access to each Joomla function. Basically within Joomla, you never load a standalone file directly for output. Everything goes through the index.php and is loaded from there.