Welcome Guest, Not a member yet? Register   Sign In
Template error !!
#1

[eluser]drakula1234[/eluser]
I am facing error since a day. I am watching videos on
Quote:http://net.tutsplus.com/articles/news/co...atch-day-1


Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined property: Page::$template

Filename: controllers/page.php

Line Number: 15

Quote:Fatal error: Call to a member function render() on a non-object in /Users/Harish/Sites/ci_otsg/application/controllers/page.php on line 15

I followed instructions on code igniter and downloaded the template 1.4 and placed the template file in the appropriate folders.

This is the template.php in view folder.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html &gt;
&lt;head&gt;
   &lt;title&gt;Template&lt;/title&gt;
   &lt;?= $_scripts ?&gt;
   &lt;?= $_styles ?&gt;
   &lt;link href="includes/front.css" media="screen, projection" rel="stylesheet" type="text/css"/&gt;
&lt;/head&gt;
&lt;body&gt;
   <div id="container">
       <div id="header">
           <div>
               &lt;?= $header?&gt;
           </div>

       </div>

   </div>
&lt;/body&gt;
&lt;/html&gt;

and this is what I have in the config folder

Code:
&lt;?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Active template
|--------------------------------------------------------------------------
|
| The $template['active_template'] setting lets you choose which template
| group to make active.  By default there is only one group (the
| "default" group).
|
*/
$template['active_template'] = 'default';


$template['active_group'] = 'default';
$template['default']['template'] = 'template.php';
$template['default']['regions'] = array(
   'header',
   'content',
   'footer',
);
$template['default']['parser'] = 'parser';
$template['default']['parser_method'] = 'parse';
$template['default']['parse_template'] = FALSE;

$template['default']['regions']['header'] = array('content' => array('<a id = "logo" href="index.php"> </a>'));

/* End of file template.php */
/* Location: ./system/application/config/template.
php */

I have a big HTML file that has to be moved to template. I started code igniter today and wanted to move my project completely code igniter. I am a newbie so I need some help on moving my file to code igniter.
#2

[eluser]drakula1234[/eluser]
I got it. I forgot to autoload the template library.




Theme © iAndrew 2016 - Forum software by © MyBB