Download the PHP package yokai/sonata-workflow without Composer
On this page you can find all versions of the php package yokai/sonata-workflow. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package sonata-workflow
Yokai Sonata Workflow
Introduction
This library add Symfony Workflow component integration within Sonata Admin.
Features
- add a menu dropdown to your admin detail pages on which you have buttons to apply available transitions
- ship a controller to apply transition
- allow to hook into the apply transition process to show an intermediate page
Code
- a Sonata Admin Extension : WorkflowExtension
- a Controller trait : WorkflowControllerTrait
- a Controller : WorkflowController
Installation
Configuration
Let say that you have an entity named PullRequest
that is under workflow and for which you have an admin.
One extension for everything
The extension is usable for many entities and with no configuration.
You only need to create a service for it, configure the controller that will handle the transition action and configure on which admin you want it available.
For instance :
note: You may noticed that we also registered the controller
Yokai\SonataWorkflow\Controller\WorkflowController
as a service. It is important, because it needs the workflow registry service to work.
More specific extension per admin
But the extension accepts many options if you wish to customize the behavior.
For instance :
What are these options ?
render_actions
: Admin action names on which the extension should render its menu (defaults to[show, edit]
)workflow_name
: The name of the Workflow to handle (defaults tonull
)no_transition_display
: Whether or not to display a button when no transition is enabled (defaults tofalse
)no_transition_label
: The button label when no transition is enabled (defaults toworkflow_transitions_empty
)no_transition_icon
: The button icon when no transition is enabled (defaults tofa fa-code-fork
)dropdown_transitions_label
: The dropdown button label when there is transitions enabled (defaults toworkflow_transitions
)dropdown_transitions_icon
: The dropdown button icon when there is transitions enabled (defaults tofa fa-code-fork
)transitions_default_icon
: The default transition icon for all transition (defaults tonull
: no icon)transitions_icons
: A hash with transition name as key and icon as value (defaults to[]
)
Hook into the transition process
Let say that when you start a review for a pull request, as a user, you will be asked to enter which users are involved in the review.
To achieve this, you will be asked to fill a dedicated form.
You only need to create a custom controller for your entity admin :
MIT License
License can be found here.
Authors
The library was originally created by Yann Eugoné. See the list of contributors.
Thank's to Prestaconcept for supporting this library.
All versions of sonata-workflow with dependencies
sonata-project/admin-bundle Version ^4.0
symfony/workflow Version ^4.4|^5.0|^6.0|^7.0