CodeIgniter Forums
Including a View in a main page from a Nav Side Bar - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Including a View in a main page from a Nav Side Bar (/thread-19757.html)



Including a View in a main page from a Nav Side Bar - El Forum - 06-18-2009

[eluser]crispinatari[/eluser]
I'm curious how i could go about only changing the main page(middle) from clicking links on a left side menu when i click on the links to generate pages. I can only get the left side menu to change where is want the main page to change to the emplink page that i call in the side_menu controller. hmmm

Code:
<head>
    
         <?= link_tag($cssfile) ?>  
        
        
       </head>  
      <body>
        <div id="navigation-block">  
            <ul id="sliding-navigation">  
                <li class="sliding-element"><a href = "http://localhost/ci1/index.php/side_menu/emplink"> Employees</a></h3></li>  
                <li class="sliding-element"><a href = "#"></a></li>  
               <li class="sliding-element"><a href="#">Link 2</a></li>  
               <li class="sliding-element"><a href="#">Link 3</a></li>  
              <li class="sliding-element"><a href="#">Link 4</a></li>  
                <li class="sliding-element"><a href="#">Link 5</a></li>  
            </ul>  
        </div>  
    &lt;/body&gt;

Code:
&lt;?php

class Side_menu extends Controller {

  function Side_menu()
  {
      parent::Controller();

      //$this->load->model('empsmodel');
      $this->load->helper('url');
      $this->load->helper('form');
      
      
  }
    
  function index()
    {
        //default method, gets data from model
        //and lists all employees using default view
        
        
          $data['title'] = "Main Content";
        //$data['heading'] = "";
        
          /// LOADING PARTIALS //
      
         $this->load->view('sidemenu', $data);
          
    }
    
        function emplink()
    {
          //form for adding an entry';
          
          $this->load->view('empslistview',$data);
    }



  }
  
  


?&gt;