Guteman Posted December 14, 2006 Share Posted December 14, 2006 I just created my first Template Class. The class itself works fine, but im having major display issues with the default template. The images dont work nor does my .css file.Here is how my folders aresystem -> template.class.phptemplates -> default -> index.phpHere is how my root index.php file is:[code]<?phprequire_once("system/template.class.php");$TemplateEngine = New Template;$TemplateEngine->SelectTemplateFile('index.php');$TemplateEngine->Compile(); ?>[/code]I can make the images work, but I dont like how I have todo it (templates/default/images/image.jpg)My question: Is there a way to have it so I still can just put in images/image.jpg? I do not want to do ../ all day either. Link to comment https://forums.phpfreaks.com/topic/30679-directories-issue/ Share on other sites More sharing options...
JasonLewis Posted December 15, 2006 Share Posted December 15, 2006 no...not just image/image.jpg. if it is in a higher directory then you have to do the templates/default/images/image.jpg... but you could, in your template file before all the images have it something like <#imgdir#> or whatever, then when you complile simply replace and occurance of <#imgdir#> using str_replace with the actual image directory... Link to comment https://forums.phpfreaks.com/topic/30679-directories-issue/#findComment-141471 Share on other sites More sharing options...
Guteman Posted December 15, 2006 Author Share Posted December 15, 2006 is there any alternative I can do to the root index.php? Link to comment https://forums.phpfreaks.com/topic/30679-directories-issue/#findComment-141607 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.