CodeIgniter Forums
return with multiple data - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: return with multiple data (/showthread.php?tid=77156)



return with multiple data - 68thorby68 - 07-26-2020

Hi,

Is it possible to use return ->with() multiple data.

For example I want to return a reference to the language file AND return a new variable ($data['mydata']).

I have tried, the following  and combination thereof (with error), so I'm wondering if this can be done? 
PHP Code:
return redirect()->back()->withInput()->with('success'lang('myfile.mytext'))->with($data['mydata']);

return 
redirect()->back()->withInput()->with('success'lang('myfile.mytext'), 'newdata'$data['mydata']);

return 
redirect()->back()->withInput($data['mydata'])->with('success'lang('myfile.mytext')); 

All help is greatly appreciated