Jump to content

Directories Issue


Guteman

Recommended Posts

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 are
system -> template.class.php
templates -> default -> index.php

Here is how my root index.php file is:
[code]<?php
require_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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.