help with loading multiple views |
[eluser]DumpProgrammer[/eluser]
I am working on my first website with CI. I have done my view file template.php like this Code: <?php $this->load->view('newheader'); ?>
[eluser]bretticus[/eluser]
Congratulations and welcome to CI. I think you are using the "model" of loading a single view template that, in turn, loads another view to display the content you need. This method is a little unorthodox but it will work. Another method is to call the views individually (just like you have them minus all the duplicate php tags) in the controller: Code: <?php Of course, if you want to stay with the template model, you need to load that view from the controller: Code: <?php and then in your template.php view: Code: <?php $this->load->view('newheader'); ?>
[eluser]DumpProgrammer[/eluser]
Thanks you have helped me a lot. Now I think I will be able to work with the pagination on the single view because thats where I realised I had a problem with this method of loading multiple views in template file. Here is glimpse of the new controller Code: class Blog extends Controller {
[eluser]Udi[/eluser]
I heavily recommend you to read my 3 blog posts about developing CMS with CodeIgniter, the first one: http://blog.umnet.co.il/2009/11/25/devel...er-part-1/ I will help you to start coding with the right approach.
[eluser]DumpProgrammer[/eluser]
thanks I have had a look at your blog and its a good tutorial. |
Welcome Guest, Not a member yet? Register Sign In |