is'this correct? (Load content from a view) |
[eluser]CI TaMeR[/eluser]
No you use one controller for 1 sometimes up to 3 views For example one controller can control company info the list of all companies in your database the single view of one company and a form to post and edit the content This would take 3 view files one controller. I share portions of the view file with all pages by having a header.php, footer.php and style.css file so that the website looks the same all over. I use this if I need to just view something and don't need any html, which is 90% of my pages. Code: <?php I call it like this from the controller: Code: $this->tpl['body'] = $this->table->generate($Calc); Otherwise my view pages look like this: Code: <?php If you need something more complex. There is an add in library someone made to control view files. I found this one but there is a better one which I couldn't find. Searching is up to you. layout_library |
Welcome Guest, Not a member yet? Register Sign In |