Simple Lightweight Routing PHP Framework.

1.1.2 2019-07-19 15:54 UTC

This package is auto-updated.

Last update: 2020-05-19 17:48:58 UTC


This is supposed to be a super simple framework for PHP projects. It barely does anything and requires the minimum amount of setup that you have probably already done before.

Why Use It

You want a framework that does nothing and that you don't have to do a lot of setup for.


  • Quick install
  • Simple routing engine


  • Apache2 (or implement your own URL rewriting)
  • PHP 7.1 and above


Run sudo a2enmod rewrite to enable the rewrite Apache extension.

Edit your apache2.conf and add this:

<Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
        Require all granted

If you haven't already, install Composer.

Then run php composer.phar install-project keythkatz/barrens . to install it into the current folder or php composer.phar install-project keythkatz/barrens [install directory] to install it into a folder of your choice.

Point your domain to the public/ folder.

At this point you should see a "Hey, it works!" message on your homepage.

.htaccess, Images, CSS and JS

By default, URLs ending in an image format, .css and .js are not handled by the router, and are served by files in the public/ directory. You can modify the public/.htaccess file to add/remove extensions.


Your code

Your code (should) live in the src/ folder.


The router initialises an instance of the specified class, then calls the function provided.

To add a route, modify the routes.php file. An example has been provided.

In general, to add a route:

	Route::[verb]([full path], [full class name to initialise], [function to call]);
	// [verb] = get, post, put, patch, delete, head, options

Use Route::cli(...) for command line-only access.


In the path, you can use {paramName} to indicate a parameter. These will be passed as an array into the provided function. Example: Route::get("/from/{from}/to/{to}", "\Example", "main") will pass ["from" => ..., "to" => ...] into \Example->main($params).