PHPackages                             modulework/routework - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. modulework/routework

ActiveModulework-module[API Development](/categories/api)

modulework/routework
====================

A basic RESTful router for PHP

16PHP

Since Jun 15Pushed 13y ago1 watchersCompare

[ Source](https://github.com/MODULEWork/ROUTEWork)[ Packagist](https://packagist.org/packages/modulework/routework)[ RSS](/packages/modulework-routework/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

ROUTEWork
=========

[](#routework)

This is a really easy to use routing class. You may know this from large framworks. But this time it is standalone!

Installation
------------

[](#installation)

- Place the `router.php` file into your application folder
- Place the `.htaccess` file into you root-site folder, adjust the `RewriteBase` as needed
- include it `include 'router.php';`
- initate it:
    `Route::tar()` &lt;- I know not my best joke :D

HOWTO &amp; Examples
--------------------

[](#howto--examples)

Now you can start defining some routes like this:

```
Route::get('/', function() {
      echo "Home";
});

```

This will display `Home` everytime you visit your url. Make sure that you always define this route.

But what about other routes? Let' s say we want to setup a basic site. We need a `contact`, `about` and `projects` page.

```
Route::get('contact', function() {
      ?>

          Contact us!

           Contact Us!

          About us!

           About Us!
           Staff:

          PROJECT |

           Interesting information...
