PHPackages                             austinbillings/rad - 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. [Framework](/categories/framework)
4. /
5. austinbillings/rad

ActiveLibrary[Framework](/categories/framework)

austinbillings/rad
==================

A simple but powerful PHP nanoframework for building APIs at light speed.

1.0.0(9y ago)134MITPHP

Since Dec 8Pushed 9y ago1 watchersCompare

[ Source](https://github.com/austinbillings/Rad)[ Packagist](https://packagist.org/packages/austinbillings/rad)[ Docs](http://github.com/austinbillings/rad)[ RSS](/packages/austinbillings-rad/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (5)Dependencies (7)Versions (2)Used By (0)

[![Rad Logo](https://camo.githubusercontent.com/dd9fae1589714bdfd7d5fbf1ff43604a46fb6c0d0918d5475df470c857075feb/687474703a2f2f61757374696e62696c6c696e67732e636f6d2f70726f6a656374732f5261642e706e67)](https://camo.githubusercontent.com/dd9fae1589714bdfd7d5fbf1ff43604a46fb6c0d0918d5475df470c857075feb/687474703a2f2f61757374696e62696c6c696e67732e636f6d2f70726f6a656374732f5261642e706e67)

*A PHP nanoframework for building APIs at light speed.*

Documentation
-------------

[](#documentation)

Rad provides the following basic classes to get you started building an API.

#### `Rad\Base`

[](#radbase)

A base class that does a whole lot of stuff I don't have time to write about.

#### `Rad\Router`

[](#radrouter)

A basic but robust router, which takes a HTTP-Request-URI as the constructor argument: `__construct($route)`.

Provides various methods to perform actions based on the given URI.

Example:

```
$router = Rad\Router($currentURI);
$entity = Rad\Base;

$router->get('/users', function ($params, $query) {
	$entity->deliver($userClass->getList());
});

$router->get('/users/:userID', function ($params, $query) {
	$entity->deliver($userClass->getUser($params["userID"]));
});
```

#### `Rad\Controller`

[](#radcontroller)

A class which provides a basic API controller. Automatically gathers data sent to `php://input` as `$this->input`, and other cool things I'll write about sooner or later.

#### `Rad\Tools`

[](#radtools)

A class which provides a collection of commonly-used (in my experience) utilities, all accessible as static methods.

Recommended usage:

```
use Rad\Tools as Tools;

class MyClass {
	public function example () {
		echo Tools::firstName('Austin Billings');
		# Returns "Austin"
	}
}
```

See more [at their documentation](https://github.com/austinbillings/Rad/blob/master/doc/Rad%5CTools.md).

### Rad\\Courier

[](#radcourier)

A class which extends `Rad\Base` and lets you easily prepare and send email server-side via **Sendgrid**, **Mandrill**, **Amazon SES**, or vanilla PHP with little to zero effort.

#### Quick CLI Example (can easily also be used as a web service)

[](#quick-cli-example-can-easily-also-be-used-as-a-web-service)

From terminal:

```
composer require austinbillings/rad
touch MySendScript.php
```

Now, the fun part:

```
