-2

am working with boostrap and codeigniter and... how make a footer and header static and only change the content?

HEADER

   <div id="content">

   </div>

FOOTER

here this http://i.imgur.com/bXs5IRQ.png

madth3
  • 7,275
  • 12
  • 50
  • 74
manuel_m2
  • 45
  • 5

2 Answers2

2

Create header.php and place in /application/views

<!DOCTYPE html>
<html lang="en">
    <head>
    ......
    do you header stuffs here

Create footer.php and place in /application/views

        <div class="footer">
        ....
        footer stuff here
        </div>
    </body>
<html>

Now in your every view file you can include header and footer files

<?php $this->load->view('header'); ?>

<div id="content">
    ... rest of the dynamic stuffs
</div>

<?php $this->load->view('footer'); ?>
Madan Sapkota
  • 25,047
  • 11
  • 113
  • 117
  • I did not explain well. I am making a system where I have a menu in the header and I have the name of the person who entered the system in the footer. I want to load only what I have in the header and footer once and only when you press on menu button to move only content. thanks – manuel_m2 Feb 26 '13 at 17:23
0

The ci has it's own template, you can use that or write your own output method in the base controller. And I think the bootstrap is a library of CSS and JS. So if you want to use style, you can include bootstrap, but if you want to format the output you should read the ci_user_guide.

dgund
  • 3,459
  • 4
  • 39
  • 64
Roy Chen
  • 1
  • 3