| Customise path problem and probably solution |
Wed, 18 January 2006 21:37 |
alucard Messages: 2 Registered: December 2005 |
Newbie |
 From: *uac69.hknet.com
|
|
Hi all.
I am now using phphtmllib 2.5.4. This project make a very interesting suggestion that, the whole extraced folder: phphtmllib should be placed in root directory to make the whole library work.
However, for some reasons I cannot put this folder under root dir. What I did is I create a folder for my project, place the phphtmllib under this folder. This project is a subdir for my root web site. To make things clear, here is the pic:
root website
|
|--myProject
|
|--phphtmllib
| |
| |-css
| |
| |-widgets
|
|--index.php
However, when I start using CSS which this library provided, the path to some CSS picture and .css file are not found (). i.e. the path isn't correct.
After digging into the phphtmllib library, I found that the following help:
1. BaseWidgets::set_image_path_prefix(<the_CSS_path>)
This method can be used to set the image path which the widget use, which is by default: /phphtmllib/image/widgets (searching in root directory, which is not correct)
2. phphtmllib/css/local_includes.inc
This file is, by default without any method which can change it and can only edit it directly, pointing to ALSO the root directory. What I did is changing this 3 lines (actually only add 1 line):
//$doc_root = $_SERVER["DOCUMENT_ROOT"];
//$phphtmllib = $doc_root."/phphtmllib";
$phphtmllib = "../../phphtmllib";
Then, I did both the above 2 to make everything work! CSS is also OK now.
Hope my experience will help those who don't want to put the library under root but in other place.
All in all, I think the assumption of putting phphtmllib under root is not always work. Wish the coming version of phphtmllib will change this.
|
|
|