Search
Other Sourcerer questions
Forum

Migrating from Jumi (J!3.x) to Sourcerer with J!4.2.2

Thomas Eppensteiner's Avatar Thomas Eppensteiner
Hi Support

I was successfully using Jumi with Joomla 3.x by calling PHP-Code using URL with parameters, e.g.:
www.domain.ch/index.php/component/jumi/ cl-chart?stn1=116&grp1=30
where "cl-chart" is the Alias of one of the Jumi Applications which has some Custom Code that reads the URL parameters and passes the arguments as a $jumi array to a php-script defined in the Jumi "Pathname" field.

I'm now looking for a way to migrate that code to Sourcerer. I want to open an URL passing parameters as shown above to my script.
How can I solve this with Sourcerer Pro ?

Thanks and regards, Tom
Peter van Westen's Avatar Peter van Westen ADMIN
You can get url parameters through the Joomla input object.
For instance, you can do:
{source}<?php
$stn1 = $app->input->getInt('stn1');
$grp1 = $app->input->getInt('grp1');
...
?>{/source}
Also see:
docs4.regularlabs.com/sourcerer/the-basics/using-php-code

And see here for more on the input object:
docs.joomla.org/Retrieving_request_data_using_JInput
Please post a rating at the Joomla! Extensions Directory
Thomas Eppensteiner's Avatar Thomas Eppensteiner
Hi Peter
Thanks for your very helpful answer; you made my day 🙂

I put the following test code into a custom module:
{source}<?php
$stn1 = $app->input->getInt('stn1');
$grp1 = $app->input->getInt('grp1');

echo "<pre>";
echo "<b>Test PHP-Skript!</b>"."\n";
echo "stn1='".$stn1."'\n";
echo "grp1='".$grp1."'\n";
echo "</pre>";
?>{/source}
and a menu item "test" opens the custom module and a single dummy article with the following URL:
j4.anydomain.ch/de/test?stn1=116&grp1=30

Web browser now shows following output:
Test PHP-Skript!
stn1='116'
grp1='30'

Thanks for your help. You may close this post as solved.
Regards, Tom
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription