Welcome Guest, Not a member yet? Register   Sign In
cleanest way to implement the main layout
#9

[eluser]wiredesignz[/eluser]
[quote author="Josh Bright" date="1302898834"]Lets say I have a basic controller as shown below, what would I be changing to take advantage of this?
Code:
<?php
class Home extends CI_Controller {
     public function index() {
          //List of news items that home/index_view will show
          $data['news_list'] = $this->db->getSomeNews();  

          //A view
          $data['content'] = "home/index_view";

          //template/render_view is a view that loads other views, header, footer, along with whats in $data['content']
          $this->load->view("template/render_view", $data);
     }
}
[/quote]

Code:
<?php

class Home extends MY_Controller {

     public function index()
     {
          //List of news items that home/index_view will show
          $data['news_list'] = $this->db->getSomeNews();  

          //A view
          return $this->load->view("home/index_view", $data, TRUE);

     }
}


Messages In This Thread
cleanest way to implement the main layout - by El Forum - 04-06-2011, 02:50 PM
cleanest way to implement the main layout - by El Forum - 04-06-2011, 03:47 PM
cleanest way to implement the main layout - by El Forum - 04-06-2011, 05:29 PM
cleanest way to implement the main layout - by El Forum - 04-14-2011, 03:51 PM
cleanest way to implement the main layout - by El Forum - 04-14-2011, 10:35 PM
cleanest way to implement the main layout - by El Forum - 04-14-2011, 11:48 PM
cleanest way to implement the main layout - by El Forum - 04-15-2011, 09:20 AM
cleanest way to implement the main layout - by El Forum - 04-15-2011, 01:15 PM
cleanest way to implement the main layout - by El Forum - 04-15-2011, 05:14 PM
cleanest way to implement the main layout - by El Forum - 04-15-2011, 05:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB