|
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 |
Schorny Smarty n00b
Joined: 15 Feb 2004 Posts: 2
|
Posted: Sun Feb 15, 2004 1:05 pm Post subject: unable to read resource |
|
|
Hi!
I'm currently playing around with Smarty - to maybe use it with my next projects.
But I can't figure out, how to set template_dir correctly (and I do have searched the forum and the wiki):
simple example:
Code: |
<?php
require_once('Smarty.class.php');
$theme='default';
$smarty=new Smarty();
$base=dirname(__FILE__);
$smarty->template_dir=$base.'/template/'.$theme;
$smarty->compile_dir=$base.'/template_c/'.$theme;
$smarty->config_dir=$base.'/config/'.$theme;
$smarty->cache_dir=$base.'/cache/'.$theme;
$smarty->assign('site_name', 'Index');
$smarty->assign('header', 'Welcome');
$smarty->assign('theme',$theme);
$smarty->display('head.tmpl');
?>
|
When I do not set template_dir, compile_dir,... and just write
$smarty->display($theme.'/head.tmpl');
everything works fine...
All directories exists and I have set all permissions to 777
There are no files in the directories, exept the templates in template_dir
This is what I get from smarty:
Warning: Smarty error: unable to read resource: "head.tmpl" in /usr/share/pear/Smarty.class.php on line 1115
I'm running Smarty 2.6.1 on a Apache2 with PHP 4.3.2
I do not have any ideas what I did wrong... |
|
Back to top |
|
Schorny Smarty n00b
Joined: 15 Feb 2004 Posts: 2
|
Posted: Sun Feb 15, 2004 1:29 pm Post subject: |
|
|
stupid me
I wrote template instead of templates - and overlooked that 's' a hundred times...
I works fine now
sorry for bothering you |
|
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
|