CodeIgniter Forums
Template question? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Template question? (/showthread.php?tid=34756)



Template question? - El Forum - 10-08-2010

[eluser]anna16[/eluser]
Hello

This is my first time to use a template using CodeIgniter.

I found this site below,
http://williamsconcepts.com/ci/codeigniter/libraries/template/index.html

And i followed the instruction.
But unfortunately i encountered this error message below,
http://coder9.com/ci/ztest.php/page/index/

Is anyone familiar with this template?
Or is there any better than this template system?

Thanks in advanced.


Template question? - El Forum - 10-08-2010

[eluser]WanWizard[/eluser]
I assume line 12 contains
Code:
$this->template->render()

Did you load the template library?


Template question? - El Forum - 10-08-2010

[eluser]anna16[/eluser]
Or maybe you can suggest a complete tutorial on managing and outputting contents on a master page?
They say using php codes alone is better than using any template system.
I'm a little confused right now.


Template question? - El Forum - 10-08-2010

[eluser]WanWizard[/eluser]
There is no definitive guide on how to generate pages, it all depends on your (projects) requirements.

If it's a small site, if the developer has full control, if the development team is small, then PHP in views (or templates) is probably Ok.
If it's a large site, if you have separate backend developers and frontend designers, if the project is built by a large team, then separation of code and presentation is usually required.

When it comes to templates (actually, partials, or sections of a page), Colin's library is quite good. Anther one is Phil Sturgeon's Template library. Both provide the option to generate a page from different sections using a single master layout.
I personally find Colin's library a bit more flexible, as it contains solutions for css and js files as well, and has support for template engines other than CI's internal parser class. It does lack proper theme support, which Phil's library does provide.


Template question? - El Forum - 10-08-2010

[eluser]anna16[/eluser]
I have already loaded it,

Code:
<?php
class Page extends Controller {
  
   function Page()
   {
      parent::Controller();
      
   }
  
   function index()
   {
      $this->load->library('parser');
      $this->template->render();

      
      $this->template->render($region = NULL, $buffer = FALSE, $parse = FALSE);
   }
}

But the same error.
Any advice?


Template question? - El Forum - 10-08-2010

[eluser]WanWizard[/eluser]
Where?

I see you load the parser, but I'm missing
Code:
$this->load->library('template');



Template question? - El Forum - 10-08-2010

[eluser]Juan Velandia[/eluser]
Hello Ana, I´ve working with this template: http://maestric.com/doc/php/codeigniter_template

It´s extremely simple, and I´ve used it in:

www.gabasip.com
www.andaki.com
www.segurosinmobiliarios.com.co
www.oeeltda.com.co
www.assa-seguros.com

I´m not an expert programmer and it´s been vey helpful

regards!


Template question? - El Forum - 10-08-2010

[eluser]anna16[/eluser]
@juan

Thanks I'll try your suggestion.