( edited ) - Creating menus |
[eluser]AntSteinn[/eluser]
/*****************ADDED**********************/ I started reading user_guide after I sent this topic. So I was reading about Views, Models and Controllers and I'm thinking for the future when I will use Template system so I can change Template in Backend. Should I have my templates folder in views folder or make new folder for templates. Is some way so the controller knows what template he should displaying? Code: $this->load->view('templates/blue/tmplfile'); Code: $template = $thatone //From database Another question Code: function user($username) Will print out: LaLaLa Is that way also for getting story from database, like if building memberslists and linking username http://explane.com/user/username ? Sorry my english. /********************************************/ Hi. I have template and I'm creating Menus by database. When I set query on template file, will come up my result. But I want have it in model/controller so it's more easy later If I will build new template and can just put get_menus(); than hole query code. Sorry my english, If someone could understand what I'm meaning will it be great get feedback. -- 1. I have template saved as ../views/templates/orginal/index.php 2. I have file saved as ../controller/beta.php It's file calling to my template and show it up on web.com/beta Code: <?php If I have only $this->load->model(''); will come up: Fatal error: Class 'MenusModel' not found in /home/chatis/public_html/system/application/views/templates/orginal/index.php on line 33 3. I have model for query from database ../model/menus/menus.php Code: <?php 4. I'm using autoload for database config. In my template file are get_menus(); trying to call and get error 8-/
[eluser]ELRafael[/eluser]
Ops, you're doing wrong ;P Controller Code: function index() Model Code: function get_menus() View Code: <!-- //In case that you use views -->
|
Welcome Guest, Not a member yet? Register Sign In |