2017 © Pedro Peláez
 

library yaml-route-service-provider

Silex Service provider for using YAML routing files

image

junker/yaml-route-service-provider

Silex Service provider for using YAML routing files

  • Friday, May 27, 2016
  • by Junker
  • Repository
  • 2 Watchers
  • 2 Stars
  • 116 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 5 Versions
  • 2 % Grown

The README.md

YamlRouteServiceProvider

Silex Service provider for using YAML routing files, (*1)

Latest Stable Version Total Downloads Build Status Scrutinizer Code Quality License, (*2)

Requirements

silex 2.x, (*3)

Installation

The best way to install YamlRouteServiceProvider is to use a Composer:, (*4)

php composer.phar require junker/yaml-route-service-provider

Examples

use Junker\Silex\Provider\YamlRouteServiceProvider;

$app->register(new YamlRouteServiceProvider('routes.yml'));

# or

$app->register(new YamlRouteServiceProvider('routes.yml', ['cache_dir' => '/tmp/routes_cache']));

Routes config example:, (*5)

# routes.yml 

home:
    path: /
    defaults: { _controller: 'Acme\Controller\AppController::indexAction' }

articles.list:
    path: /articles
    defaults: { _controller: 'Acme\Controller\ArticlesController::indexAction' }

articles.view:
    path: /articles/{slug}
    defaults: { _controller: 'Acme\Controller\ArticlesController::viewAction' }

Controller example:, (*6)

# Acme\Controller\ArticlesController.php

use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

namespace Acme\Controller;

class ArticlesController
{
    public function indexAction(Request $request, Application $app)
    {
        ...

        return new Response($articles);
    }

    public function viewAction(Request $request, Application $app, $slug)
    {
        ...

        return new Response($article);
    }
}

Documentation

Symfony Routing, (*7)

The Versions

27/05 2016

dev-master

9999999-dev

Silex Service provider for using YAML routing files

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kosenkov

silex route yaml router

27/05 2016

0.1.3

0.1.3.0

Silex Service provider for using YAML routing files

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kosenkov

silex route yaml router

19/02 2016

0.1.2

0.1.2.0

Silex Service provider for using YAML routing files

  Sources   Download

MIT

The Requires

 

by Dmitry Kosenkov

silex yaml

10/02 2016

0.1.1

0.1.1.0

Silex Service provider for using YAML routing files

  Sources   Download

MIT

The Requires

 

by Dmitry Kosenkov

silex yaml

10/02 2016

0.1.0

0.1.0.0

Silex Service provider for using YAML routing files

  Sources   Download

MIT

The Requires

 

by Dmitry Kosenkov

silex yaml