CodeIgniter Forums
how to pass flashdata as data inside a view that will be returned as data - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: how to pass flashdata as data inside a view that will be returned as data (/showthread.php?tid=77879)



how to pass flashdata as data inside a view that will be returned as data - nellyblissville - 10-30-2020

my view implementation is such that all my views are passed as data to rendered on a general template. however sometimes i also need to pass data inside these views that are to be returned as views.

for example

PHP Code:
public function myview()
{
  $_SESSION['error] = 'this is an error';
  $this->session->mark_as_flash('
error');
  
  //creating the view
  //this is the page that will be passed as data
  $page_content['
content'] = $this->$this->load->view('example-folder/example-page', $example-data, TRUE);
  
  //this is the template layout page
  $this->load->view('
nurse/home', $page_data);

My question is how do i pass the flashdata to be rendered in the $page_content['content']?