include() or require() in Custom files

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
alex
User
Posts: 267

include() or require() in Custom files

Post by alex »

Hello!

I use a custom file "generator.php". "Include custom file" is enabled, also "/myroute" (no quotes) is set where I keep some templates which must be included running "generator.php" file.

If I use absolute path then it works as expected. The question is if it is possible to use relative paths e. g.:

require '../config/dbconn.php';
include("include/datelocal.php");
include('my_template.html');


arbei
User
Posts: 9384

Post by arbei »

It is better to use __DIR__, see Magic constants.


alex
User
Posts: 267

Post by alex »

Thank you!


Post Reply