[eluser]dannieWalden[/eluser]
Hey gurus.
I just started using the template library. i’ve followed the userguide several times to get i right, but i get following error:
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Page::$parser
Filename: libraries/Template.php
Line Number: 574
Cant find out why?
Can anyone help me, please
controller:
Code:
<?
class Page extends Controller {
function Page()
{
parent::Controller();
}
function index()
{
$this->load->library('Template');
// Write to $title
//$this->template->write('title', 'Welcome to the Template Library Docs!');
// Write to $content
//$this->template->write_view('content', 'main/login_form');
// Write to $sidebar
//$this->template->write_view('sidebar', '<h1>sidebar</h1>');
// Render the template
$this->template->render();
}
}
?>
configfile:
Code:
$template['active_group'] = 'default';
$template['default']['template'] = 'template.php';
$template['default']['regions'] = array(
'header',
'title',
'content',
'sidebar',
'footer',
);
$template['default']['parse_template'] = TRUE;
templatefile:
Code:
<html>
<head>
<title><?= $title ?></title>
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>
<div id="wrapper">
<div id="header">
<?= $header ?>
</div>
<div id="main">
<div id="content">
<h2><?= $title ?></h2>
<div class="post">
<?= $content ?>
</div>
</div>
<div id="sidebar">
<?= $sidebar ?>
</div>
</div>
<div id="footer">
<?= $footer ?>
</div>
</div>
</body>
</html>