2017 © Pedro Peláez
 

library sylex

Sylex is a tiny layer on top of Silex framework.

image

umpirsky/sylex

Sylex is a tiny layer on top of Silex framework.

  • Tuesday, November 20, 2012
  • by umpirsky
  • Repository
  • 1 Watchers
  • 5 Stars
  • 45 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Sylex Build Status

Sylex is a tiny layer on top of Silex framework., (*1)

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

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., (*3)

{
    "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());., (*4)

Check Silex on Steroids demo application to see it in action., (*5)

Tests

To run the test suite, you need PHPUnit., (*6)

$ phpunit

License

Sylex is licensed under the MIT license., (*7)

The Versions

20/11 2012

dev-master

9999999-dev

Sylex is a tiny layer on top of Silex framework.

  Sources   Download

MIT

The Requires