• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.