Download the PHP package jildertmiedema/commander without Composer
On this page you can find all versions of the php package jildertmiedema/commander. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jildertmiedema/commander
More information about jildertmiedema/commander
Files in jildertmiedema/commander
Informations about the package commander
Domain commander
=========
This package is able run domain commands easily. Commands are used to separate domain logic from your php framework.
This package is based on Laravel Commander build by JeffreyWay.
Installation
Install through Composer.
What does it do
- It creates a command object. The command object is data transfer object between the framework/controller and the domain logic.
- It will fill the command object with the request data (For example
$_GET
,$_POST
,$app['request']->query->all()
). - It will try to find a validator class, when it's found it will validate the input.
- If decorators have been set it will execute the decorators. (For example a sanitizer).
- It will find and execute the handler for the command.
Integrate to the framework
Silex
This package can easily be used in Silex.
It will try to find a handler(required) and a validator (not required) from application container using the following convention.
Usage:
Example:
For a full example see silex.php
For usage in controllers see CommanderController.php
Vanilla php
To use commander in another framework you can use this code:
The vanilla php solution does not support out-of-the-box dependency injection, therefore you need to implement a translator and a resolver.
An example vanilla.php
Creating your own translator and resolver
For integration with a another framework you can implement your own translator
and resolver
.
Examples
Run the examples
Visit: