From 8b0a574051146ece7af0ebcebf5fecbd80df671b Mon Sep 17 00:00:00 2001 From: a-sansara Date: Tue, 14 Mar 2017 22:04:16 +0100 Subject: [PATCH] update README, source code header --- .gitignore | 2 ++ README.md | 18 ++++++++++-------- composer.json | 2 +- .../Provider/ControllerServiceProvider.php | 8 ++++++++ 4 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d1502b0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +vendor/ +composer.lock diff --git a/README.md b/README.md index df68a0c..50d698d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# MetaTech\Silex\ControllerServiceProvider +# MetaTech Silex ControllerServiceProvider A service provider for [ Silex ](http://silex.sensiolabs.org) for managing DI and mounting on controllers. @@ -53,14 +53,14 @@ use Acme\Ctrl\Test; $app->register(new ControllerServiceProvider(Test::class, [$app], '/test', 'ctrl.')); ``` -**first parameter** is your *controller class* -**second parameter** is an array of your *controller depencies* -**third parameter** define your controller *routing entry point* -**fouth parameter** define your *service 's namespace* to acces your controller (default ctrl.) +*first parameter* is your **controller class** +*second parameter* is an array of your **controller depencies** (default []) +*third parameter* define your controller **routing entry point** (default '/') +*fouth parameter* define your **service 's namespace** to access your controller (default 'ctrl.') -the name of the registering service is the *given namespace* followed by your *controller class shortname* +The name of the registering service is the `given namespace` followed by your `controller class shortname` -with the previous example `$app['ctrl.Test']` is now available and return your controller instance. +With the previous example `$app['ctrl.Test']` is now available and return your controller instance. the `connect` method of your controller can now benefits of this service to define appropriate routes, like that : @@ -82,7 +82,9 @@ class Test implements ControllerProviderInterface } ``` -see source code of `MetaTech\Core\Ws` for an advance controller architecture. +Controller 's routes are mount on the defined routing entry point (third parameter); + +see source code of `MetaTech\Silex\Ws\Controller` in [ meta-tech\silex-core ](https://github.com/meta-tech/silex-core) for an advance controller architecture. ### License diff --git a/composer.json b/composer.json index 9e3f712..8e547a4 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name" : "meta-tech/silex-controller-service", "type" : "library", "homepage" : "https://github.com/meta-tech/silex-controller-service", - "description" : "Controller service for Silex.", + "description" : "Controller service provider for Silex2.", "license" : "MIT", "authors" : [ { diff --git a/src/MetaTech/Silex/Provider/ControllerServiceProvider.php b/src/MetaTech/Silex/Provider/ControllerServiceProvider.php index a66dc60..451fcbb 100644 --- a/src/MetaTech/Silex/Provider/ControllerServiceProvider.php +++ b/src/MetaTech/Silex/Provider/ControllerServiceProvider.php @@ -1,4 +1,12 @@