CodeIgniter Forums
Question: CI4 function for CI3 $this->CI->load->view('a') - 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: Question: CI4 function for CI3 $this->CI->load->view('a') (/showthread.php?tid=81094)



Question: CI4 function for CI3 $this->CI->load->view('a') - Renkman - 01-24-2022

Hi folks,
I'm sorry, but I can't figure out how to load a view in CI4 like in CI3, when I need the sourcecode only:
$content = $this->CI->load->view('about/developer/modalform', $data, TRUE);
Is there a function in CI4 I missed?


RE: Question: CI4 function for CI3 $this->CI->load->view('a') - kilishan - 01-24-2022

The `view` function returns a string so you can either return that string (normal use case) or assign that content to a variable, like you're wanting to do here.

PHP Code:
$content view('about/developer/modalform'$data); 



RE: Question: CI4 function for CI3 $this->CI->load->view('a') - Renkman - 01-27-2022

[quote pid="393264" dateline="1643033294"]
PHP Code:
OMG... sorry for the late responseit works... thanks a lot kilishan... so many trees.. but sometimes I don't see the forrest...  

[/quote]