2017 © Pedro Peláez
 

library pagon

Pagon starter app

image

pagon/pagon

Pagon starter app

  • Wednesday, December 24, 2014
  • by hfcorriez
  • Repository
  • 33 Watchers
  • 206 Stars
  • 571 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 29 Forks
  • 2 Open issues
  • 22 Versions
  • 0 % Grown

The README.md

Pagon

Pagon is Modern PHP framework with elegant syntax. It also allow you to build RESTful web applications quickly and easily., (*1)

Other languages: 中文文档, (*2)

Quick Started

Installation

Pagon use Composer to manage its dependencies. First you need to have Composer installed globally., (*3)

You can also download a copy of the composer.phar in your repository's root, run a command such as the following:, (*4)

``` bash curl -s https://getcomposer.org/installer | php, (*5)


#### via Download/Git [Download] source files from Github or clone from Github ``` bash $ git clone git@github.com:hfcorriez/pagon.git myapp $ composer install # php composer.phar install

Via Composer Create-Project

``` bash $ composer create-project pagon/pagon myapp # php composer.phar ..., (*6)


### Debugger server You can use Pagon built-in debugger server for rapid development under development environment. please use a ` Nginx` or `Apache` server for production environment. ``` bash $ ./bin/pagon serve [-p|--port <PORT>] Pagon serve at http://127.0.0.1:5000

Configuration

All of the configuration files for the Pagon are stored in the app/config directory., (*7)

Optional attributes, (*8)

mode        # Runing mode
debug       # Debug mode
views       # Template directory
buffer      # Open a buffer or not
timezone    # timezone (default: UTC)
charset     # charset (default: UTF-8)
autoload    # Auto load directory
error       # Handle error or not
routes      # Routes
names       # Router name, auto created
alias       # Class aliases, for short class name
namespaces  # Namespaces
engines     # Template engines
errors      # Default errors
stacks      # stacks
mounts      # mounts
bundles     # bundles
locals      # locals
url_rewrite # Url rewrite or not

Routing

To get started, let's create our first route. In Pagon, the simplest route is a route to a Closure., (*9)

// Init app
$app = Pagon::create();

// Routing with a callback function
$app->get('/', function($req, $res) {
  $res->render('index.php');
});

// Routing with a class method
$app->get('/users/:id', 'Web\\User');

// Specify named parameters in your routes
$app->post('/users/:id(/:op)', 'Web\\UserOperator');

// Run app
$app->run();

Database

Pagon ships with a superb ORM: Paris. More detailed documentation and examples, please check out Paris Doc., (*10)

Simple Example, (*11)

$users = \Model\User::dispense()->where('status', 1)->find_many();

Migration

Init Database schema, (*12)

./bin/cli db:init

Will execute file app/migrations/schema.sql, (*13)

Migrate, Status, (*14)

$ ./bin/cli db:generate AddUserLoginTime
+f ./migrations/20141208030747_AddUserLoginTime.php

$ ./bin/cli db:status

 Status   Migration ID    Migration Name
-----------------------------------------
   down  20141208030747  AddUserLoginTime

$ ./bin/cli db:migrate
 == 20141208030747 AddUserLoginTime migrating
 == 20141208030747 AddUserLoginTime migrated 0.0084s

Except init command, all the other commands map to phpmig to execute。, (*15)

Cli

Manage PHP shell for *unix console, (*16)

./bin/cli, (*17)

$app->command('db\:init', '\Command\DB\Init');
$app->command('queue\:start', '\Command\Queue\Start');

Execution, (*18)

$ ./bin/cli db:init
$ ./bin/cli queue:start

Showcase

iNews: https://github.com/Trimidea/inews, (*19)

License

Copyright (c) 2014-2015 hfcorriez. MIT Licensed, see LICENSE for details., (*20)

The Versions

24/12 2014

dev-master

9999999-dev

Pagon starter app

  Sources   Download

MIT

The Requires

 

The Development Requires

pagon skelton

07/12 2014
07/12 2014
07/12 2014
04/10 2014
26/12 2013

0.7.9

0.7.9.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

25/10 2013

0.7.8

0.7.8.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

24/10 2013

0.7.7

0.7.7.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

24/10 2013

0.7.6

0.7.6.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

21/09 2013

0.7.5

0.7.5.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

28/08 2013

0.7.4

0.7.4.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

28/08 2013

0.7.3

0.7.3.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

28/08 2013

0.7.2

0.7.2.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

11/08 2013

0.7.1

0.7.1.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

11/08 2013

0.7.0

0.7.0.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

24/07 2013

0.6.3

0.6.3.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

25/05 2013

0.6.2

0.6.2.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

21/05 2013

0.6.1

0.6.1.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

15/05 2013

0.6.0

0.6.0.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

18/04 2013

0.5.2

0.5.2.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

17/04 2013

0.5.1

0.5.1.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon

02/04 2013

0.5.0

0.5.0.0

Pagon Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

framework pagon