List PHP plugin - accessing the selected rows data

GabPag

New Member
Hi,

In List PHP plugin, accessing the selected rows data with the code:

$ids = $app->input->get('ids', array(), 'array');

return this error:
Debug: Eval exception : list php plugin : Since joomla/application 2.0.0: Accessing the input property of Joomla\Application\AbstractWebApplication is deprecated, use the Joomla\Application\AbstractWebApplication::getInput() method instead.

Using:

$app->getInput()->get('myparam',...);

doesn't work. How can I chage the code?


Thank you!
 
Deprecated messages are only notices, only shown with system debug on.

But
$app->getInput()->get('ids', array(), 'array');
is working.
(WIKI example code is updated now).
 
I came across a similar message recently in a Form field element where the Default value was populated (as per Wiki page https://fabrikar.com/forums/index.php?wiki/element-default-examples) via:
$myInput = JFactory::getApplication();
$myParam = $myInput->getInput('parent_id','');
return $myParam;


It still works, but I get a debug message at the bottom of the page of:
An error has occurred with a eval'd field - please inform the web-site owner. Debug: Caught exception on eval of parent_id: Since joomla/application 2.0.0: Accessing the input property of Joomla\Application\AbstractWebApplication is deprecated, use the Joomla\Application\AbstractWebApplication::getInput() method instead.

Wondering if https://fabrikar.com/forums/index.php?wiki/element-default-examples needs to be updated as well (when someone gets a chance)?

Thanks!
 
WIKI is public.
Please feel free to correct/add.
Updated the page (I didn't realize that we could edit it ourselves and thanks for the heads-up). I'm now using the following and it seems to work without issue.

PHP:
$myInput = \Joomla\CMS\Factory::getApplication()->getInput();
$myParam = $myInput->get('your_url_param', '');
return $myParam;
 
Back
Top