• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question about the template logic (Phil's template library)

Phil's template library is working fine for me (http://philsturgeon.co.uk/code/codeigniter-template)
But until now I was only dealing with different controllers and their views. Today decided to work on some general stuff and here is the case...
I have header_tpl.php which I am loading all the time with the help of MY_Controller.php
function MY_Controller()

        $this->template->set_partial('header', 'header_tpl', FALSE);

So far, so good... But now I want to add a menu in this header. Navigation menu. And here is my problem. The menu will be generated from the info from my database. For example I have a table "categories" and in this table I have 1 => "movies", 2 => "music", 3 => "images"
(this is because different users will have different options in the menu)
and my question is:
I can make a function get_menu_items(), but where should I place it? In MY_Controller.php I think it is not soo good idea Sad
And in this function there will be db stuff (model maybe)?
And second ... how to add the recieved data in the template? set_partial does not have a forth parameter $data

Phil template is good, but the documentation and examples are poor Sad

Messages In This Thread
Question about the template logic (Phil's template library) - by El Forum - 07-28-2010, 08:08 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.