Welcome Guest, Not a member yet? Register   Sign In
question about views and a main layout file
#1

[eluser]jvittetoe[/eluser]
i am trying to create a simple app that will basically have the same basic layout from page to page. how can i got about creating a main layout file like this...
Code:
<html>
<head>
</head>
<body>

<h1>Hi</h1>
<ul id="nav">
<li>link</li>
<li>link</li>
<li>link</li>
</ul>


<div id="mainContent">
//i want to load each view here
// basically i want to load the main layout file each time with a different view
// here depending on which page they go to. ie; login, register, profile, yada yada...

</div>


<ul id="footer">
<li>link</li>
<li>link</li>
<li>link</li>
</ul>



&lt;/body&gt;
&lt;/html&gt;

and just swapping the views from inside the #mainContent.

an example login view that i want loaded inside of #mainContent
Code:
<h2>Login Here</h2>
&lt;form&gt;
...
&lt;/form&gt;
#2

[eluser]esra[/eluser]
You might start here:

http://codeigniter.com/wiki/Displaying_Multiple_Views/

and here:

http://ellislab.com/forums/viewthread/44916/

There are wiki articles on using various template engines with CodeIgniter (YATS, TinyButStrong, etc.), as well as instructions or guidelines for using other template engines in the forums (e.g., Smarty, bTemplate, TemplateFlexy, etc.).
#3

[eluser]jvittetoe[/eluser]
awesome, thanks.
#4

[eluser]jvittetoe[/eluser]
well it seems my validation doesn't work now. do i have to pass something to the view files?




Theme © iAndrew 2016 - Forum software by © MyBB