• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Template library 1.4 problem

#1
[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 Wink


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();
   }
  
}
?&gt;

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:
&lt;html&gt;
   &lt;head&gt;
      &lt;title&gt;&lt;?= $title ?&gt;&lt;/title&gt;
      &lt;link rel="stylesheet" type="text/css" href="main.css" /&gt;
   &lt;/head&gt;
   &lt;body&gt;
      <div id="wrapper">
         <div id="header">
            &lt;?= $header ?&gt;
         </div>
         <div id="main">
            <div id="content">
               <h2>&lt;?= $title ?&gt;</h2>
               <div class="post">
                  &lt;?= $content ?&gt;
               </div>
            </div>
            <div id="sidebar">
               &lt;?= $sidebar ?&gt;
            </div>
         </div>
         <div id="footer">
            &lt;?= $footer ?&gt;
         </div>
      </div>
   &lt;/body&gt;
&lt;/html&gt;


Messages In This Thread
Template library 1.4 problem - by El Forum - 12-20-2010, 11:58 AM
Template library 1.4 problem - by El Forum - 12-20-2010, 02:06 PM
Template library 1.4 problem - by El Forum - 08-01-2011, 07:13 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.