项目作者: lenochware

项目描述 :
Lightweight PHP framework
高级语言: PHP
项目地址: git://github.com/lenochware/pclib.git
创建时间: 2015-11-05T12:51:03Z
项目社区:https://github.com/lenochware/pclib

开源协议:

下载


What is PClib?

Lightweight PHP framework without boilerplate of big frameworks.

Features

  • MVC (Controllers, templates and models)
  • Db: Database layer (mysql, pgsql and sql-lite adapters included)
  • Form: Rendering, validation and storing into database
  • Grid (datagrid): Pagination, sorting columns, summarization rows, filter
  • Auth: Authentication and authorization: users, roles and permissions
  • Translator: multilanguage support
  • Debugger: improved error messages, dump() function, debug-bar…
  • ORM
  • PAdmin: Site administrator tool
  • Logger, Tree view and more…

Installation

  1. Download pclib
  2. Copy directory pclib somewhere at your webroot.
  3. Some parts of the library need a few database tables. You can
    found sql-dump in install/pclib_*.sql. Import this sql-dump into your database.
  4. Now you are ready to use pclib!

or install it using composer:

  1. composer require lenochware/pclib

Examples

Render form

  1. require 'vendor/autoload.php'; // or 'pclib/pclib.php' without composer
  2. $app = new PCApp('test-app');
  3. $form = new PCForm('tpl/form-template.tpl');
  4. print $form;

Connect to database and show datagrid with data

  1. require 'vendor/autoload.php';
  2. $app = new PCApp('test-app');
  3. $app->db = new PCDb('pdo_mysql://user:password@localhost/database-name');
  4. $grid = new PCGrid('tpl/grid-template.tpl');
  5. $grid->setQuery('SELECT * FROM products');
  6. print $grid;

For more examples see http://pclib.brambor.net/

License

This source code is licensed under the MIT license found in the LICENSE file
in the root directory of this source tree.