Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Unable to load template (Hosted site)

 
Post new topic   Reply to topic    Smarty Forum Index -> Article Discussions
View previous topic :: View next topic  
Author Message
mark1997
Smarty n00b


Joined: 02 Apr 2019
Posts: 1

PostPosted: Wed Apr 03, 2019 12:24 am    Post subject: Unable to load template (Hosted site) Reply with quote

I have this code

Code:
 {extends "`$root`public\included_template\user\user_index_structure.tpl"}


where $root is https://www.scoa.org/SCOA/ is my site but i got a error saying that

Code:
Fatal error: Uncaught --> Smarty: Unable to load template 'https://www.scoa.org/SCOA/public/included_template/user/user_index_structure.tpl' in .....


i tried


    .../../../SCOA/
    /SCOA/


but nothing works, is there way to include or extends a file from a document root ??
Back to top
View user's profile Send private message
bsmither
Smarty Pro


Joined: 20 Dec 2011
Posts: 218
Location: West Coast

PostPosted: Fri Apr 05, 2019 1:39 am    Post subject: Reply with quote

According to https://www.smarty.net/docs/en/resources.tpl the section "Templates from any directory", you need to specify a computer's filesystem path - not a URI.

So, you might try:
Code:
{extends "`$smarty.server.document_root`/public/included_template/user/user_index_structure.tpl"}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Article Discussions 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