Welcome Guest, Not a member yet? Register   Sign In
Add dynamic content to a template in code igniter
#1

[eluser]drakula1234[/eluser]
Hello,

I am trying a HTML/CSS file to convert to a template. I asked for help but I didn't receive any suggestions in that post yet I tried to figure out a way to create a template. I am having few glitches in doing that. My controller has main.php file which is the main page of the website, and I have register where the header, footer, and rest remain same except that main content changes when the page loads.

I have the following template in the views folder:


Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html &gt;
&lt;head&gt;
   &lt;title&gt;&lt;?= $title ?&gt;&lt;/title&gt;

   &lt;style type="text/css"  &gt;
       @import url('&lt;?=base_url()?&gt;/includes/front.css');
       @import url('&lt;?=base_url()?&gt;/images/');
   &lt;/style&gt;

&lt;/head&gt;
&lt;body&gt;
   <div id="container">
       <div id="header">
            &lt;?= $logo ?&gt; &lt;!--This is an image tag to display the image on the template --&gt;
            &lt;?= $topnav ?&gt;
       </div>

       <div id="menubar">
            &lt;?= $menulist ?&gt;
       </div>

       <div id="maincontent">
           &lt;?= $flashcontent ?&gt;
           &lt;?= $resources ?&gt;
           &lt;?= $registerForm ?&gt;
       </div>

       <div id="footer">
           <div>
               &lt;?= $footertable1 ?&gt;
           </div>
       </div>
   </div>
&lt;/body&gt;
&lt;/html&gt;

The flashcontent and resources are supposed to be in the main page and registerForm is supposed to be shown when I click on register in the main page. I have been reading the template user guide in the code igniter but I am unable to understand how to make this dynamic. Please help me in getting over this issue.

Thanks in Advance !!




Theme © iAndrew 2016 - Forum software by © MyBB