Welcome Guest, Not a member yet? Register   Sign In
Template library - Any suggestions?
#1

[eluser]Mauricio de Abreu Antunes[/eluser]
I was trying to find any template library but i found only old libraries (CI 1.7) or template library by Phil, but its documentation is not available.
I have a lot of repetead pages that only change their main contents and others modules.
Is that library good http://ellislab.com/forums/viewthread/208484/?

Any suggestions?
#2

[eluser]Noobigniter[/eluser]
Hi,

Personally, I wanted something clean, so I made like this:

Code:
application/
-- views/
---- templates/
------ layout_center.php
------ layout_full.php
------ layout.php
------ partials/
--------- head.php
--------- header.php
--------- aside.php
--------- footer.php


In layout.php, i have :

Code:
<?php $this->load->view('templates/partials/head');?>
<?php $this->load->view('templates/partials/header');?>
<section class="container-fluid">
  <section class="row-fluid">
   <section id="page" class="span9">
&lt;?php $this->load->view($page);?&gt;
   </section>
   <aside role="complementary" id="aside" class="span3">
&lt;?php $this->load->view('templates/partials/aside');?&gt;
   </aside>
  </section>
&lt;?php $this->load->view('templates/partials/footer');?&gt;
</section>
&lt;/body&gt;
&lt;/html&gt;

And in my controller, I added this:

Code:
$data['page'] = 'users/profil';
$this->load->view('templates/layout_full', $data); // (layout_full, layout_center, …)

If this can help you ...


Regards.
#3

[eluser]Mauricio de Abreu Antunes[/eluser]
I got your point.
You're loading your views into your view.




Theme © iAndrew 2016 - Forum software by © MyBB