Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

unable to read resource

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Schorny
Smarty n00b


Joined: 15 Feb 2004
Posts: 2

PostPosted: Sun Feb 15, 2004 1:05 pm    Post subject: unable to read resource Reply with quote

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
View user's profile Send private message
Schorny
Smarty n00b


Joined: 15 Feb 2004
Posts: 2

PostPosted: Sun Feb 15, 2004 1:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP