• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved -- Help me in working with colins template library

#1
[eluser]Ram2810[/eluser]
Hi everyone am unable to get results that are stated in userguide of the template pls some do help me

The code files are as follows , the library,views,config are all same as downloaded i will paste here the controller page code and view page code... hope some one will help me...

views/page_view.php[b]

Code:
<html>
   <head>
      <title><?= $title ?></title>
      <link rel="stylesheet" type="text/css" href="main.css" />
   </head>
   <body>
      <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;
[b]controller/page.php

Code:
&lt;?php
class Page extends Controller {

   function Page()
   {
      parent::Controller();
   }

   function index()
   {
      $this->template->write('title','page_view','Introduction to Template');
      $this->template->write_view('header', 'page_view',$this->template);
      $this->template->write_view('content', 'page_view',$this->template);
      $this->template->render();
   }

}

?&gt;

THE REGIONS CODE AS IN TEMPLATE.PHP IS AS FOLLOWS
Code:
$template['default']['template'] = 'template';
$template['default']['regions'] = array(
    'title',
   'content',
);
$template['default']['regions']['header'] = array('content' => array('<h1>CI Rocks!</h1>'));
$template['default']['regions']['footer'] = array('content' => array('<p id="copyright">© Our Company Inc.</p>'));
$template['default']['parser'] = 'parser';
$template['default']['parser_method'] = 'parse';
$template['default']['parse_template'] = TRUE;

when i call the page controller i am getting a blank page ,with no title or content anything...

Pls do guide me here

Thank you

#2
[eluser]Ram2810[/eluser]
pls anyone give me a hand here pls

#3
[eluser]Ram2810[/eluser]
I forgot to activate short php tags ... i should have been more carefull

Thank you


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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