|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
eniac Smarty Rookie
Joined: 14 Jun 2003 Posts: 7
|
Posted: Sat Jun 14, 2003 9:45 pm Post subject: Newbie question |
|
|
This is my index.php file
Code: |
<?php
define("SMARTY_DIR","../smarty/");
require(SMARTY_DIR."Smarty.class.php");
include("include/smarty_setup.php");
$Smarty = &new smarty_setup;
$smarty->assign('test','trallala eindelijk het werkt');
$smarty->display("index.tpl");
? |
This is my smarty_setup file:
Code: |
<?php
class Smarty_setup extends Smarty
{
var $tpl_dir = "/www/www.kemu.be/public_html/mysql/templates";
var $com_dir = "/www/www.kemu.be/public_html/mysql/templates_c";
var $cache_dir = "/www/www.kemu.be/public_html/mysql/cache";
var $conf_dir = "/www/www.kemu.be/public_html/mysql/configs";
function Smarty_setup()
{
$this->template_dir = $this->tpl_dir;
$this->compile_dir = $this->com_dir;
$this->cache_dir = $this->cache_dir;
$this->config_dir = $this->conf_dir;
}
}
?>
|
Now I don't get why I get this error
Fatal error: Call to a member function on a non-object in /home/webusers/kemu/www/www.kemu.be/public_html/mysql/index.php on line 7
Since Smart_setup extends Smarty
Any idea's ? |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Sat Jun 14, 2003 9:56 pm Post subject: |
|
|
$Smarty != $smarty (variable-names are case-sensitive) |
|
Back to top |
|
eniac Smarty Rookie
Joined: 14 Jun 2003 Posts: 7
|
Posted: Sat Jun 14, 2003 10:24 pm Post subject: |
|
|
ok that fixed a lot now I got this probleme.
Warning: Smarty error: unable to read template resource: "index.tpl" in /home/webusers/kemu/www/www.kemu.be/public_html/smarty/Smarty.class.php on line 999
I'm sure I've set my template_dir correct. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Sun Jun 15, 2003 6:59 am Post subject: |
|
|
"/home/webusers/kemu/www/www.kemu.be/public_html/" != "/www/www.kemu.be/public_html/" . maybe somewhere you intermix the chroot-dir you see via ftp with the actual directory the webserver accesses.
btw: you don't call the constructer of the parent-class in your child-class. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|