Warum sollte es das
INCLUDEPHP
nicht funktionieren. Klar das es auf den Inhalt der PHP Datei ankommt.
Wenn ich im root eine PHP Datei Namens
test.php
mit diesem einfachen Inhalt erstelle:
Code: Alles auswählen
<?php
echo "Normal year:\n"; // February has 28 days
$dt = new DateTimeImmutable("2015-01-31 00:00:00", new DateTimeZone("Europe/Berlin"));
echo "Start: ", $dt->format("Y-m-d H:i:s P"), PHP_EOL;
$dt = $dt->modify("last day of next month");
echo "End: ", $dt->format("Y-m-d H:i:s P"), PHP_EOL;
echo "Leap year:\n"; // February has 29 days
$dt = new DateTimeImmutable("2016-01-31 00:00:00", new DateTimeZone("Europe/Berlin"));
echo "Start: ", $dt->format("Y-m-d H:i:s P"), PHP_EOL;
$dt = $dt->modify("last day of next month");
echo "End: ", $dt->format("Y-m-d H:i:s P"), PHP_EOL;
In die
pages_blank.html
setze ich diese INCLUDEPHP-Anweisung
{% INCLUDEPHP 'test.php' %}
erfolgt eine korrekt Ausgabe, wenn PHP in Templates erlauben aktiviert ist.