[eluser]xzela[/eluser]
Hi all,
I'm having an issue loading a view from within a view. I continue to get a "An Error Was Encountered" error message when viewing any of the pages.
Here is the source code to the view I'm trying to use:
main_view.php
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="icon" href="<?php echo base_url();?>favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo base_url();?>favicon.ico" type="image/x-icon" />
<?php echo snappy_style('styles.css'); //autoloaded ?>
<title>Mango - Main</title>
</head>
<body>
<?php
$this->load->view('_global\header');
$this->load->view('_global\menu');
?>
<h1>Welcome to Mango</h1>
<p>Mango is Awesome</p>
<?php
$this->load->view('_global\footer');
?>
</body>
</html>
header.php
Code:
<?php
?>
<!-- START HEADER_VIEW -->
<div id="header">
<h1>Mango © version 1.428</h1>
<div style="float: right; height: 25px;">
Welcome <?php echo $user_data['user_name']; ?> - <?php echo $user_data['ip_address']; ?>
</div>
</div>
<!-- END HEADER_VIEW -->
<?php
/* End of file header_view.php */
/* Location: ./system/application/views/header_view.php */
?>
When I load the view within the browser I get the "An Error Was Encountered" and the page stops rendering.
Quote:An Error Was Encountered
Unable to load the requested file: _global\header.php
If i comment out the external views, everything seems to be working. And if i just view the header view by itself, it renders properly. Am I loading these view incorrectly? Is there a better (best practices) way to this?
Let me know what you guys think.
Thanks