tags:

views:

1130

answers:

1

I am using Jumi to include a number of PHP scripts on Joomla! articles and it works great. The problem I am having is with passing variables (in the form of $_GET parameters) to a PHP script.

Lets say I have a script "index.php" and I wish to pass the $_GET[] parameter "var" with the value of "10". This would normally be accomplished by pointing to: index.php?var=10. How do "emulate" this functionality with Jumi? I was hoping it would be as simple as:

{jumi [directory/index.php] [var=10]}

The above syntax however is not correct.

Any input would be appreciated.

-- Nicholas

+1  A: 

After some trial and error and guidance from the official Joomla! forums I did solve my problem. Rather than passing a true $_GET[] parameter you can pass a $jumi array and reference that.

I wanted to avoid having to rewrite much of my script so what I did was the following.

1) Make the Jumi call like this:

{jumi [directory/index.php] [value]}

2) In index.php:

if(isset($jumi[0]))
{
    $_GET['PARAM_YOU_WANT_SET'] = $jumi[0];
}

This is a very simple example of a quick and easy way to emulate passing a $_GET[] parameter to a script using Jumi. This approach saved me a great deal of time because I didn't have to rewrite my controller.

-- Nicholas

Nicholas Kreidberg