@aubrey
To access another view in CodeIgniter, you can use the load method of the CodeIgniter's $this->load object. Here is an example of how you can access another view in CodeIgniter:
1
|
$this->load->view('another_view'); |
This will load the "another_view.php" file from the views folder and display it in the browser.
1 2 3 4 5 |
$data = array( 'title' => 'My Title', 'content' => 'My Content' ); $this->load->view('another_view', $data); |
In the "another_view.php" file, you can access the data using the variable names specified in the $data array. For example, you can display the title and content using the following code:
1 2 |
<h1><?php echo $title; ?></h1> <p><?php echo $content; ?></p> |
By following these steps, you can easily access another view in CodeIgniter and pass data to it.