[eluser]Unknown[/eluser]
Sorry noob here, I am stuck and can't seem to figure it how it works.
What i want is to have a seperate application namely
nav that returns a string/links.
I want that application
nav to be called by my main application
layout and use its return value on the layout_view.
Ex. I have 2 applications namely
1.
layout
Code:
class Layout extends Controller {
function Layout()
{
parent::Controller();
}
function index()
{
$this->load->library('parser');
$data['title'] = "Title";
$data['loadcss'] = '<link rel="stylesheet" href="{WEB_ROOT}images/styles.css" type="text/css" media="screen, projection" charset="utf-8" />';
$data['WEB_ROOT'] = "http://localhost/CI/system/application/";
$this->parser->parse('layout_view', $data);
}
}
2.
nav
Code:
class Nav extends Controller {
function Nav()
{
parent::Controller();
}
function index()
{
$this->load->library('parser');
$data['WEB_ROOT'] = "http://localhost/CI/system/application/";
$this->parser->parse('nav_view', $data,true);
}
}
Layout_view code
Code:
<html>
<head>
<title>{title}</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
{loadcss}
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table id="Table_01" width="1000" height="auto" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<img src="{WEB_ROOT}images/main_01.gif" width="341" height="149" alt=""></td>
<td class="right_logo">
</td>
</tr>
<tr>
<td colspan="2" class="nav_bar">{nav}
</td>
</tr>
<tr>
<td colspan="2" class="content">
</td>
</tr>
<tr>
<td colspan="2" class="footer">
</td>
</tr>
</table>
</body>
</html>
nav_view code
Code:
<td>Home</td>
<td>About</td>
<td>Gallery</td>
<td>Contact</td>
How can I get the return value of the
nav application and use it on my
layout application then pass it on the layout view {nav} as you can see on the table class nav_bar. This is to be used for different page regions but I don't want to use any template library. What i want is different page regions have its own application.
Is this possible? Hope I made myself clear. Sorry I am really a 1 day CI noob. TIA