Resolve Directory Question
I've read a bunch of threads, but I'm definitely missing something.
Here's my layout:
public_html
->index.php
->modules->directory.php
->views->directory_edit.php
index calls modules which calls views
inside modules/directory.php:
include 'views/directory_edit.php'; <= This doesn't resolve
I've tried:
adding views as a Resource Root in Settings | Directories
adding a constant to provide the absolute path on the remote server rather than the relative path
I haven't tried:
making all paths absolute
Thanks!
Please sign in to leave a comment.
Hi Stephane,
In index.php (which is, I assume, your entry point for all URLs), define some constant with current path, e.g.
Then use it with include:
This will make all paths absolute: constant (website root) + relative to the website root folder.
Alternatively, you could try this in your modules/directory.php: (include/require is relative to the current folder first, and only then searching trough include_path):