2017 © Pedro Peláez
 

library piece-of-cake

Piece of Cake is a basic MVC framework for fast performance.

image

flik/piece-of-cake

Piece of Cake is a basic MVC framework for fast performance.

  • Thursday, March 30, 2017
  • by flik
  • Repository
  • 2 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

piece-of-cake

New MVC framework with lot of flexibility. Work in progress..., (*1)

Installation:

composer install

Composer detail:, (*2)

http://rapidsol.blogspot.com/2015/03/download-composerphar.html, (*3)

DB Configuration:

//Config/database.php 

Common Functions:

//framework/bootstrap.php 

Check routes like laravel and cakephp routes:

//Config/routes.php
$Route = array(
    '/'             => "/home",     // /xapp/home.php 
    '/page/smarty'          => "page",      // redirect with smarty template engine. /xapp/page.php 
    '/post'             => "post",       
    '/contact'              => "contact",                      
    '/test'             => "test",      
    '/about'            => "User@index",  // /xapp/Controller/UserController.php and action index()  
    '/api/v1/auth/token'    => "User@login",  // ControllerName@ActionName same like cakephp or laravel 
    '/api/test'         => "User@testx"              

);

Form like zend:

// https://github.com/adamwathan/form for documentation
$frm = new AdamWathan\Form\FormBuilder;

$years = ['1990' => 1990, '1991' => 1991, '1992' => 1992];
$model = json_decode(json_encode(array('full_name'=>'John Doe', 
                    'bio'=>'', 
                    'color'=>'',
                    'terms'=>'',
                    'birth_year' => 1991 , 
                    'email'=>'john@example.com', 
                    'date_of_birth'=> '1985-05-06' 
                )));
?>

= $frm->open(); ?>
= $frm->bind($model); ?> 


= $frm->text('full_name'); ?>
= $frm->email('email')->required(); ?>
= $frm->text('date_of_birth'); ?>
= $frm->radio('color', 'red'); ?>
= $frm->checkbox('terms')->uncheck(); ?>
= $frm->select('birth_year',$years); ?>
= $frm->textarea('bio')->rows(5)->cols(20)->addClass('important')->value('My biography'); ?>
= $frm->submit('Submit'); ?> = $frm->close(); ?>

Validation like laravel and record save like cakephp:

//http://github.com/Wixel/GUMP for documentation
use GUMP as V; // write at top

//example use in UserController.php
$input = $_REQUEST;
$is_valid = V::is_valid($input, array(
                'username' => 'required|alpha_numeric',
        'password' => 'required|max_len,100|min_len,6'
        ));

if ($is_valid === true) {
    // continue
} else {
    return $this->respond($is_valid, 401);
}

//https://github.com/flik/X for documentation
//initializing users table
X::manage('users');
$member = X::where('email', '=', $input['email']);

if (!empty($member))
    $this->respond(['Email already exist!'], 401);

$salt = '10$02afa11535df310febf1d0';
$e = new  PasswordEncryptor_Blowfish();
$encypted_password = $e->encrypt($input['password'], $salt, null);

$data = array();

$data['email'] = $input['email']; 
$data['password'] = $encypted_password;
X::save($data);

The Versions

30/03 2017

dev-master

9999999-dev https://github.com/flik/piece-of-cake.git

Piece of Cake is a basic MVC framework for fast performance.

  Sources   Download

MIT

The Requires

 

database framework mvc mysql