-
Notifications
You must be signed in to change notification settings - Fork 1
Simple Example
micahbaumann edited this page Oct 12, 2022
·
2 revisions
- Install the URLS framework (see this guide).
- Create a new file named
blog-home.php
and fill it with:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>My Blog - Home</title> </head> <body> <h1>This is my Blog</h1> <p>Welcome!</p> </body> </html>
- Open the file you chose as your settings in your editor. It should look something like this:
<?php /* URLS framework url config file. Add your paths here: ex. $urls->path('blog/', 'blog-home.php', true); */ include 'urls/Urls.php'; Urls::$base = '/'; $urls = new Urls; $urls->exe(); ?>
- Add
$urls->path('blog/', 'blog-home.php', true);
to your settings file underinclude 'urls/Urls.php';
. Here is the file now:<?php /* URLS framework url config file. Add your paths here: ex. $urls->path('blog/', 'blog-home.php', true); */ include 'urls/Urls.php'; Urls::$base = '/'; $urls = new Urls; $urls->path('blog/', 'blog-home.php', true); $urls->exe(); ?>
- If you did not specify a base url, go to
http://yourdomain.com/blog/
. If you did specify a base url, go tohttp://yourdomain.com/<your base url>/blog/
. You should see the contents of the theblog-home.php
file.
For more examples see GUIDES.
The source code for this example is at https://github.com/urls-framework/URLS/tree/main/examples/Simple%20Example/src.