定制 rosengate/exedra 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rosengate/exedra

最新稳定版本:v1.0.15

Composer 安装命令:

composer require rosengate/exedra

包简介

Nestful route oriented PHP micro framework

README 文档

README

Build Status MIT Licence

A nestful route oriented PHP Microframework.

Introduction

This PHP microframework focuses on nestable/groupable URI path/segments based routing, that allows you to prototype your application through URI routing without losing control over it's depth. Route is unique and identifiable by name, tag and queriable through request dispatch, or finder within URL factory. Along with nested routing, is middlewarable routing group to give you more control over your application design.

The goal is to be contextual, explicitful while being simple and extremely minimal at the same time. It can be intended to work as a supporting framework to your existing application.

Features

  • Nestable routing
  • Minimal, contextual, flexible, components agnostic
  • Annotated based route-action controller (optional)
  • Routing component built for Psr7 Http Messages
  • Psr7 middleware support
  • Container based
  • Explicit dependency injection (not auto wiring)

Documentation

More detailed documentation and installation can be found at http://exedra.rosengate.com/docs

Installation

composer require rosengate/exedra

Example

Just an example to quickly test exedra.

Create an index.php file with the following contents.

<?php
use Exedra\Routing\Group;
use Exedra\Runtime\Context;
use Exedra\Application;

require_once __DIR__ . '/vendor/autoload.php';

$app = new Application(__DIR__);

$app->map['web']->any('/hello')->group(function (Group $group) {
    $group->middleware(function (Context $context) {
        return strtoupper($context->next($context));
    });

    $group['welcome']->get('/:name')->execute(function (Context $context) {
        return 'Hello ' . $context->param('name');
    });
});

$app->dispatch();

And run a simple web server on the same dir.

php -S localhost:9000

Then open up your browser and type http://localhost:9000/hello/world to get your HELLO WORLD.

Heads up to the documentation http://exedra.rosengate.com/docs for more detailed setup.

Thank you!

I hope you guys like it!

License

MIT License

统计信息

  • 总下载量: 1.96k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 15
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-09