I'm using
$jinput = JFactory::getApplication()->input;
to get an array of the input from a page.
I then use:
$foo = $jinput->get('jform', '', 'raw');
I can then echo $foo['formFieldName'] which prints out the correct value
I then want to change the value to something else
$foo['formFieldName'] = "newValue";
But when I get the array again it doesn't change the value.
I'm guessing that there is some sort of setter that needs to be used but I can't get anything to work. Can anyone point me to an example that might work.
edit
I should have put full code. I did put the value back into the original array:
$jinput = JFactory::getApplication()->input;
$foo = $jinput->get('jform', '', 'raw');
echo $foo['formFieldName'];
$foo['formFieldName'] = "newValue";
$foo = $jinput->set('jform', $foo);
$jinput = JFactory::getApplication()->input;
$foo['formFieldName'] = "newValue";
echo "<br>revised foo ".$foo['formFieldName'];
exit;
This does show the change in name but after this the system still seems to put in the previous value - like it's held by a global variable or similar.
I'm guessing that it's how I've put it into the code sequence.
get
method again, it will return the original value. Try using JInput 'set'$jinput
data?