Welcome Guest, Not a member yet? Register   Sign In
Detailed Explanation of a Controller & Model?
#1

(This post was last modified: 08-31-2015, 06:30 AM by Josh1985. Edit Reason: code block formatting errors )

Hi all,

Can anyone explain for a newbie to CodeIgniter a pratical example of how to set up a tabular template using <div> tags in CodeIgniter? What I mean is this: I have spent hours scouring the web looking for a PRACTICAL version of step by step tutorials that not only explains the general idea of what a controller is and does but I would like some instruction on how you are supposed to know when and how to call in say a CI library, arbitrary HTML code, or php code. I have a pretty firm understanding of HTML in that every tag has an open tag a and a close tag, where they go in a html document and why. BUT, when it comes to codeigniter every tutorial I have found only either covers the same thing the codeigniter manual does-which is just a brief overview of how everything works together. OR it shows you how someone created a controller for what they are trying to do which in no way relates to what I am trying to do. What I am hoping someone can help me do is this:

I already have 4 HTML pages created outside of codeigniter for a custom XAMPP dashboard for myself, all up and working. What I am looking to do is take my existing pages and have codeigniter load in the static content such as the header, main container's html, the topnav html, the left nav html, sitecontent area html, and the footer into one single views file then have the dynamic content that changes page to page be inserted into its respective page's sitecontent area. This way I can avoid having to make changes to all 4 html files to change a "template element" such as adding a nav link; if I were to do that.

Below is the code for the index page to give you an example. I will include the others in the next post should you all need them.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <meta content="en-us" http-equiv="Content-Language">
 <meta content="text/html; charset=windows-1252" http-equiv="Content-Type">
 <title>XAMPP Dashboard</title>
 <link rel="stylesheet" type="text/css" href="/css/main.css" media="screen" />
 <link rel="stylesheet" type="text/css" href="/css/print.css" media="print" />
</head>
<body>
<div id="main">
 <div id="logo"><img alt="XAMPP" src="/images/logo/xampp.png"></div>
 <div id="nav" class="menu horizontal noprint">
  <ul>
   <li><a href="/">Dashboard</a></li>
   <li><a href="/applications.html">Applications</a></li>
   <li><a href="/faq.html">FAQs</a></li>
    <li><a href="/howto.html">HOW-TO Guides</a></li>
   <li><a href="/xampp/dashboard/phpinfo.php">PHPInfo</a></li>
  </ul>
 </div>
 <div id="columns">
  <div id="toc" class="menu noprint column">
   <div id="lnav1head">
     Utilities
    </div>
    <div id="lnav1menu">
    <ul>
     <li><a href="/phpmyadmin">phpMyAdmin</a></li>
    </ul>
    </div>
    <div id="lnav2head">
     Projects
    </div>
    <div id="lnav2menu">
    <ul>
     <li><a href="/xampp/dashboard/">XAMPP</a></li>
     <li><a href="/goldentempel/">Golden Tempel</a></li>
     <li><a href="/project1/">Project #1</a></li>
    </ul>
    </div>
   </div>
  <div id="contents" class="column">
    <div id="sitecontent">
    <h1>Welcome to <font face="Arial Rounded MT Bold"><font size="inherit">XAMPP</font></font> for Windows 5.6.11</h1>
     You have successfully installed XAMPP on this system! Now you can start using Apache, MySQL, PHP and other components. You can find more info in the<a href="/">FAQs</a> section or check the <a href="/">HOW-TO Guides</a> for getting started with PHP applications. Start the XAMPP Control Panel to check the server status.
    <h1>Community</h1>
     XAMPP has been around for more than 10 years – there is a huge community behind it. You can get involved by joining our <a href="https://community.apachefriends.org">Forums</a>, adding yourself to the <a href="https://www.apachefriends.org /community.html#mailing_list">Mailing List</a>, and liking us on <a href="https://www.facebook.com/we.are.xampp">Facebook</a>, following our exploits on <a href="https://twitter.com/apachefriends">Twitter</a>, or adding us to your <a href="https://plus.google.com/+xampp/posts">Google+</a> circles.
    <h1>Contribute to <font face="Arial Rounded MT Bold"><font size="inherit">XAMPP</font></font>translation</h1>
     Can you help translate XAMPP for other community members? We need your help to translate XAMPP into different languages. We have set up a site, <a href="https://translate.apachefriends.org/">translate.apachefriends.org</a>, where users can contribute translations.
    <h1>Install applications on <font face="Arial Rounded MT Bold"><font size="inherit">XAMPP</font></font> using Bitnami</h1>
    Apache Friends and Bitnami are cooperating to make dozens of open source applications available on XAMPP, for free. Bitnami-packaged applications include Wordpress, Drupal, Joomla! and dozens of others and can be deployed with one-click installers. Visit the <a href="http://bitnami.com/stack/xampp?utm_source=bitnami&amp;utm_medium=installer&amp;utm_campaign=XAMPP%2BModule">Bitnami XAMPP page</a> for details on the currently available apps.
    </div>
   </div>
  </div>
<div id="footer">Page created by: Josh Davis.<br>&copy<a href="http://www.apachefriends.org">Apache Friends</a></div>
</div>
</body>
</html>

Any help you could offer would be greatly appreciated!
Thank you again,
Josh
Reply


Messages In This Thread
Detailed Explanation of a Controller & Model? - by Josh1985 - 08-30-2015, 11:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB