Welcome Guest, Not a member yet? Register   Sign In
Use TemplatePower with CodeIgniter
#1

[eluser]Unknown[/eluser]
Hi all,

Yesterday I posted a message about some errors I got while using TemplatePower with CI.
Well, I found the solution, and i thought: I'll share this with others ( I couldn't find a single solution on Google ).

Library 'Tpl':
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

require_once ( BASEPATH .'application/libraries/TemplatePower.php' );

class Tpl extends TemplatePower
{
        
    public function Load ( $file )
    {
                
        $this -> TemplatePower ( $file );
        log_message ( 'debug' , 'TemplatePower Class Intialized' );
                
    }
        
}

And put your TemplatePower class in the libraries folder too.
Use it like this:

Code:
<?php

$this -> tpl -> Load ( $tplfile );
$this -> tpl -> Prepare ();
$this -> tpl -> printToScreen ();

Btw: Thanks to: http://ellislab.com/forums/viewthread/44719/P0/

If you need help: feel free to ask your question Wink




Theme © iAndrew 2016 - Forum software by © MyBB