定制 umpirsky/sylex 二次开发

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

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

umpirsky/sylex

Composer 安装命令:

composer require umpirsky/sylex

包简介

Sylex is a tiny layer on top of Silex framework.

README 文档

README

Sylex is a tiny layer on top of Silex framework.

There is a controller base class with some handy shortcut methods. It will also inject the container into your controllers.

Example

<?php

class ArticleController extends Sylex\Controller
{
    public function listAction()
    {
        return $this->render(
            'article/list.html.twig',
            array('articles' => $this->get('manager.article')->findAll())
        );
    }

    public function createAction(Request $request)
    {
        $form = $this->get('form.article');

        if ('POST' == $request->getMethod()) {
            $form->bindRequest($request);

            if ($form->isValid()) {
                $this->get('manager.article')->persistArticle($form->getData());

                return $this->redirect($this->generateUrl('article_list'));
            }
        }

        return $this->render(
            'article/create.html.twig',
            array('form' => $form->createView())
        );
    }
}

Installation

The recommended way to Sylex is through composer.

{
    "require": {
        "umpirsky/sylex": "*"
    }
}

Setup

There are two ways to start using Sylex. You can use Sylex\Application class or register the service provider: $app->register(new Sylex\ServiceProvider());.

Check Silex on Steroids demo application to see it in action.

Tests

To run the test suite, you need PHPUnit.

$ phpunit

License

Sylex is licensed under the MIT license.

统计信息

  • 总下载量: 51
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-11-12