CodeIgniter Forums
about $view->setData($data); - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31)
+--- Thread: about $view->setData($data); (/showthread.php?tid=66685)



about $view->setData($data); - startbbs - 11-21-2016

i have an very strange problem.

$view->setData($data) and $pager->makelinks() could not be exist in same controller. I don't know why.
once put them into same controller, the variable of setData will become "Undefined variable: $XXXXX".


RE: about $view->setData($data); - kilishan - 11-21-2016

If you are trying to access data that you didn't explicitly make available to a view, then it won't be there. By default, it will not save data used in one view to use in another view, even if that view is called from within it. You can always use the save_data option to change that.

Is that what you're seeing? Or are you trying to access setData variables within the pagination templates? Or is it something else?