I am redirecting to view from a controller and I want to send an array from controller to view. I am using :
$data = JRequest::getVar('jform', array(), 'post', 'array');
I want to pass this array to view named confirmation.
$this->setRedirect(JRout::-('index.php?option=com_contact&view=confirmation');
This redirects to view but how can I access the $data array in the view file ?
You shouldn't be sending data from the controller to the view. Joomla is a MVC (model view controller) design, as such your business logic for getting, setting, and modifying data should be in your model.
Modify your code to follow MVC design and you should have access to your data object in your view through the model.