Layout Engine |
[eluser]Unknown[/eluser]
Hello. I'm new in CodeIgniter's world. I wanna ask for experienced CodeIgniter's users what layout engine they like to use. Also I wanna ask if I really have to load views for every controller function. For example: Code: class Blog extends Controller { Thanks.
[eluser]jedd[/eluser]
Hi Heliton, Quote:Also I wanna ask if I really have to load views for every controller function. You could load your header & footer views into variables, in the constructor of your Blag class - and then just echo them out in your final view. Alternatively you can extrapolate that approach up another level by extending the core controller (lookup MY_Controller in the user guide). I've rambled about this at some length [url="http://codeigniter.com/wiki/Header_and_Footer_and_Menu_on_every_page_-_jedd/"]in the wiki[/url].
[eluser]Vicente Russo[/eluser]
I personaly use only one view, and inside that view, I use the include('includes/header.php') and include('includes/footer.php'). But you can add layout support like RubyOnRails into CodeIgniter
[eluser]helmutbjorg[/eluser]
/controllers/test.php Code: function index() { /views/template.php Code: <html> /views/index.php Code: <p>This is custom index content</p> /views/example.php Code: <p>And this is the example page content</p> Pretty easy really eh! |
Welcome Guest, Not a member yet? Register Sign In |