From 7fbe414965ad889d2bf977c34c68eb3db2551967 Mon Sep 17 00:00:00 2001 From: SteamPixel Date: Mon, 7 Sep 2020 10:21:29 +0200 Subject: [PATCH] Added include example --- include-example.php | 10 ++++++++++ index.php | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 include-example.php diff --git a/include-example.php b/include-example.php new file mode 100644 index 0000000..df2e312 --- /dev/null +++ b/include-example.php @@ -0,0 +1,10 @@ + +

Blog

+ +
+ Hey! Read my new blog post with this cool slug: "" +
+ +

+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. +

diff --git a/index.php b/index.php index 81503e7..3209fe5 100644 --- a/index.php +++ b/index.php @@ -25,6 +25,7 @@ function navi() {
  • contact form
  • get+post example
  • test.html
  • +
  • How to push data to included files
  • PHP Info
  • aTrailingSlashDoesNotMatter
  • aTrailingSlashDoesNotMatter/
  • @@ -50,6 +51,13 @@ Route::add('/index.php', function() { // Simple test route that simulates static html file // TODO: Fix this for some web servers +Route::add('/blog/([a-z-0-9-]*)', function($slug) { + navi(); + include('include-example.php'); +}); + +// This example shows how to include files and how to push data to them +// TODO: Fix this for some web servers Route::add('/test.html', function() { navi(); echo 'Hello from test.html';