2017 © Pedro Peláez
 

project barrens

Simple Lightweight Routing PHP Framework.

image

keythkatz/barrens

Simple Lightweight Routing PHP Framework.

  • Wednesday, July 11, 2018
  • by keythkatz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 100 % Grown

The README.md

barrens

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., (*1)

Why Use It

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

Features

  • Quick install
  • Simple routing engine

Requirements

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

Setup

Run sudo a2enmod rewrite to enable the rewrite Apache extension., (*3)

Edit your apache2.conf and add this:, (*4)

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

If you haven't already, install Composer., (*5)

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., (*6)

Point your domain to the public/ folder., (*7)

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

.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., (*9)

Usage

Your code

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

Routing

The router initialises an instance of the specified class, then calls the function provided., (*11)

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

In general, to add a route:, (*13)

    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., (*14)

Parameters

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)., (*15)

The Versions

11/07 2018

dev-master

9999999-dev https://github.com/keythkatz/barrens

Simple Lightweight Routing PHP Framework.

  Sources   Download

MIT

The Requires

  • php ^7.1

 

framework

11/07 2018

1.1.0

1.1.0.0 https://github.com/keythkatz/barrens

Simple Lightweight Routing PHP Framework.

  Sources   Download

MIT

The Requires

  • php ^7.1

 

framework

21/01 2018

1.0.2

1.0.2.0 https://github.com/keythkatz/barrens

Simple Lightweight Routing PHP Framework.

  Sources   Download

MIT

The Requires

  • php ^7.1

 

framework

20/01 2018

1.0.1

1.0.1.0 https://github.com/keythkatz/barrens

Simple Lightweight Routing PHP Framework.

  Sources   Download

MIT

framework

18/01 2018

1.0.0

1.0.0.0 https://github.com/keythkatz/barrens

Simple Lightweight Routing PHP Framework.

  Sources   Download

MIT

framework