2017 © Pedro Peláez
 

library forrest

validator and database middleware for PHP

image

jnbruno/forrest

validator and database middleware for PHP

  • Friday, July 1, 2016
  • by jnbruno
  • Repository
  • 1 Watchers
  • 0 Stars
  • 157 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 1 % Grown

The README.md

forrest

validator and database middleware for PHP, (*1)

Get Started

Install via composer

Add forrest to composer.json configuration file., (*2)

$ composer require jnbruno/forrest

And update the composer, (*3)

$ composer update
// Initialize with composer autoload
require 'vendor/autoload.php';


// Initialize
$forrest = new forrest([
    'database_type' => 'mysql',
    'database_name' => 'name',
    'server' => 'localhost',
    'username' => 'your_username',
    'password' => 'your_password',
    'charset' => 'utf8'
]);

SELECT

//select($table,$join,$where)
$test->select('test',[
            'number as this_is_number',
            'text',
            'email'
            ],
            [
            "LIMIT" => 5,
            "ORDER" => "number ASC"
]);


INSERT

//table($tablename)
$result = $test ->table('test')
//add rules condition
                ->rules([
                            'number'     => "required|numeric",
                            'text'       => "required|min_len,6",
                            'email'      => "required|valid_email"
                        ])

//validate then insert if valid
                ->insert([
                            'number'     => "1",
                            'text'       => "Forrest Test Text",
                            'email'      => "me@jnbruno.com"
                        ]);

UPDATE

$result = $test ->table('test')
                ->rules([
                            'number'            => "required|numeric",
                            'text'              => ["required|min_len,6", "trim"],
                            'email'             => "required|valid_email"
                        ])

            //  ->update($items, $where)
                ->update([
                                'number'       => "1",
                                'text'         => "                 Forrest Test Update                 ",
                                'email'        => "me@jnbruno.com"
                        ], ['test_id' => 1]);

License

Forrest is under the MIT license., (*4)

DEPENDENCIES

The Versions

01/07 2016

dev-master

9999999-dev

validator and database middleware for PHP

  Sources   Download

by John Noel

01/07 2016

0.0005

0.0005.0.0

validator and database middleware for PHP

  Sources   Download

by John Noel

01/07 2016

0.0004

0.0004.0.0

validator and database middleware for PHP

  Sources   Download

by John Noel

03/06 2016

0.0002

0.0002.0.0

validator and database middleware for PHP

  Sources   Download

by John Noel

03/06 2016

0.0003

0.0003.0.0

validator and database middleware for PHP

  Sources   Download

by John Noel

03/06 2016

0.0001

0.0001.0.0

validator and database middleware for PHP

  Sources   Download

by John Noel

03/06 2016

0.0.9

0.0.9.0

validator and database middleware for PHP

  Sources   Download

by John Noel

03/06 2016

0.0.8

0.0.8.0

validator and database middleware for PHP

  Sources   Download

by John Noel

03/06 2016

0.0.7

0.0.7.0

validator and database middleware for PHP

  Sources   Download

by John Noel

26/05 2016

0.0.2

0.0.2.0

validator and database middleware for PHP

  Sources   Download

by John Noel

26/05 2016

0.0.5

0.0.5.0

validator and database middleware for PHP

  Sources   Download

by John Noel

26/05 2016

0.0.6

0.0.6.0

validator and database middleware for PHP

  Sources   Download

by John Noel

28/04 2016

0.0.1

0.0.1.0

validator and database middleware for PHP

  Sources   Download

by John Noel

28/04 2016

0.0.0

0.0.0.0

validator and database middleware for PHP

  Sources   Download

by John Noel