A PHP framework, kinda maybe
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
lube
packages/upload
.htaccess
README.md
config.ini
index.php
lube.php

README.md

LUBE

LUBE

Sander Van Damme - Angry Moustache
AC² - Thanks for the wonderful banner

Remember to configure the "config.ini" file first!


Functions

Debug tools

Makes a pretty vardump using pre tags:

Debug::dump($text);

Migrations

TODO


Routes

To create a Route you must first navigate to the app/Routes.php file.
You can create the following routes:

GET

If you want to use the default controller:

Route::get('/users');
Route::get('/users/[id]');

Or if you want to use your own controllers:

Route::get('/users', 'UserController@index');
Route::get('/users/[id]', 'UserController@index');

POST

Route::post('/users');
Route::post('/users', 'UserController@post');

PATCH/PUT

Route::patch('/users/[id]');
Route::patch('/users/[id]', 'UserController@patch');

Route::put('/users/[id]');
Route::put('/users/[id]', 'UserController@put');

If you want all of the above in one line, you can create a Recourse:

Recourse::new('users');
Recourse::new('users', 'UserController');

Controllers

To create your own controller, make a new file and name with the following syntax: NAME + 'Controller'. After that, simply use this code (example for UserController.php):

<?php

    class UserController extends Controller
    {
        public $tablename = 'users';
    }

Here, you can override the functions, like index, show, etc. You can view all functions in the lube/controllers/Controller.php file.


Calls

When using a controller you can use Calls to quickly and easily make database calls. For example, GETing everything in the users table:

$data = Call::select('users')->get();

Here is a list of every Call you can do:

Call starters

Select

Call::select($table, $select = '*')->...

Insert

Call::insert($table, $array)->...

Update

Call::update($table)->...

Delete

Call::delete($table)->...

Call adders

Where

->where($what, $is, $sign = '=')->...

Set

->set($what, $to = null)->...

TODO: more

Finishers

These end your call.

Ending a GET

->get();

Ending a POST/PATCH/DELETE/...

->go();