|
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 |
qwerty_2013 Smarty n00b
Joined: 18 Nov 2011 Posts: 2
|
Posted: Fri Nov 18, 2011 1:04 pm Post subject: Smarty 3 Installation Does not Work!!! |
|
|
Hello! I have one problem during the installation:
Fatal error: Call to a member function createTemplate() on a non-object in C:\Program Files (x86)\PHP\Smarty\sysplugins\smarty_internal_templatebase.php on line 47
setup.php
Code: |
require('Smarty.class.php');
class Smarty_cti extends Smarty
{
function Smarty_cti()
{
function __construct()
{
parent::__construct();
$this->template_dir = '/smarty/templates/';
$this->compile_dir = '/smarty/templates_c/';
$this->config_dir = '/smarty/configs/';
$this->cache_dir = '/smarty/cache/';
//$this->caching = true;
$this->assign('app_name', 'cti');
}
}
}
|
index.php
Code: |
require('setup.php');
$smarty = new Smarty_cti();
$smarty->assign('name', 'Alex');
$smarty->display('index.tpl');
|
Please HELP me!!! What is wrong???
I use:
Smarty 3.1.5
PHP 5.2.13
Apache 2.2
Last edited by qwerty_2013 on Mon Nov 21, 2011 7:14 am; edited 1 time in total |
|
Back to top |
|
rodneyrehm Administrator
Joined: 30 Mar 2007 Posts: 674 Location: Germany, border to Switzerland
|
Posted: Fri Nov 18, 2011 1:31 pm Post subject: |
|
|
you don't have a problem with installation. You have a problem with »valid syntax, wrong thought«. Please have a very good look at the constructor of Smarty_cti (and then remove the PHP4-style constructor wrapping the PHP5-style constructor). _________________ Twitter |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Nov 18, 2011 2:42 pm Post subject: |
|
|
And it's now mandatory to use the setter methods to setup the directories
Code: |
class Smarty_cti extends Smarty
{
function __construct()
{
parent::__construct();
$this->setTemplateDir( '/smarty/templates/');
$this->setCompileDir( '/smarty/templates_c/');
$this->setConfigDir( '/smarty/configs/');
$this->setCacheDir('/smarty/cache/');
//$this->caching = true;
$this->assign('app_name', 'cti');
}
} |
|
|
Back to top |
|
qwerty_2013 Smarty n00b
Joined: 18 Nov 2011 Posts: 2
|
Posted: Mon Nov 21, 2011 7:20 am Post subject: |
|
|
Thanks a lot! It's work now! But with some little changes: removed the first slash "/"
Code: |
require('Smarty.class.php');
class Smarty_cti extends Smarty
{
function __construct()
{
parent::__construct();
$this->setTemplateDir('smarty/templates/');
$this->setCompileDir('smarty/templates_c/');
$this->setConfigDir('smarty/configs/');
$this->setCacheDir('smarty/cache/');
//$this->caching = true;
$this->assign('app_name', 'cti');
}
}
|
Last edited by qwerty_2013 on Tue Nov 22, 2011 4:36 am; edited 1 time in total |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Mon Nov 21, 2011 10:52 am Post subject: |
|
|
Ups, yes you are right. It was treated as an absolute path otherwise... |
|
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
|