Jump to content

Recommended Posts

Posted

Im trying to use smarty but im having trouble with it.

if anyone can help me out.

 

i uploaded the smarty folder downloaded on smarty.php.net in the root level.

 

in my php file i set following path: require('/home/MY_USER_NAME/smarty/libs/Smarty.class.php');

 

then i have the following code:

 

$smarty = new Smarty();

 

$filepath = MY_USER_NAME;

 

$smarty->template_dir = '/home/' . $filepath . '/public_html/templates';

$smarty->compile_dir = '/home/' . $filepath . '/public_html/templates_c';

$smarty->cache_dir = '/home/' . $filepath . '/public_html/cache';

$smarty->config_dir = '/home/' . $filepath . '/public_html/configs';

 

i set chmod the templates_c and cache folder to 777

 

then i have this code:

 

$page = 'index';

$section = 'index';

 

$smarty->assign('smarty', $smarty);

$smarty->assign('page', $page);

$smarty->assign('section', $section);

$smarty->display('template.tpl');

 

 

i have a template called template.tpl inside the template forlder.

 

and if i go to my site im getting the following error message: Warning: Smarty error: unable to read resource: "template.tpl" in /home/xhclznld/smarty/libs/Smarty.class.php on line 1095

 

PLEASE ANY HELP WILL BE APPRECIATED

 

thanks

jeremie

Posted

Hi Bruce,

 

i did. i use smarty at work everyday. already installed it several time. for some reason it wont work here. im not sure about the path im suppose to use on TCH

Posted

I would try changing the statements that look like this to your actual path:

 

>$smarty->template_dir = '/home/' . $filepath . '/public_html/templates';

 

to

 

>$smarty->template_dir = '/home/yourCpanelName/public_html/templates';

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...