Welcome Guest, Not a member yet? Register   Sign In
returning views as a data
#1

Hi!
I've just installed for first time CI4, and one thing I can't see in docs is old feature of returning views as a data.
This was done by adding third bool parameter (true) when loading view.
I can see that now there are array as a third option parameter, so is there any option similar to this old feature?

Thx
Reply
#2

(02-26-2020, 02:38 PM)dp41646 Wrote: Hi!
I've just installed for first time CI4, and one thing I can't see in docs is old feature of returning views as a data.
This was done by adding third bool parameter (true) when loading view.
I can see that now there are array as a third option parameter, so is there any option similar to this old feature?

Thx

In CI4 views are actually returning data, so you could do this in controller:
PHP Code:
$pageContent $view->render('myview'); //now $pageContent has rendered HTML page 

Also you might find interesting new feature ViewCells, it works same way: https://codeigniter4.github.io/userguide...cells.html
Reply




Theme © iAndrew 2016 - Forum software by © MyBB