CodeIgniter Forums

Full Version: Template question?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]anna16[/eluser]
Hello

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

I found this site below,
http://williamsconcepts.com/ci/codeignit...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.

El Forum

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

Did you load the template library?

El Forum

[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.

El Forum

[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.

El Forum

[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?

El Forum

[eluser]WanWizard[/eluser]
Where?

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

El Forum

[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!

El Forum

[eluser]anna16[/eluser]
@juan

Thanks I'll try your suggestion.