PHPackages                             rezzza/ruler-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rezzza/ruler-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

rezzza/ruler-bundle
===================

A simple stateless production rules engine for Symfony 2.

2712.8k3PHP

Since Dec 15Pushed 10y ago4 watchersCompare

[ Source](https://github.com/rezzza/RulerBundle)[ Packagist](https://packagist.org/packages/rezzza/ruler-bundle)[ RSS](/packages/rezzza-ruler-bundle/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

RulerBundle
===========

[](#rulerbundle)

A simple stateless production rules engine for Symfony 2.

Integration of [Hoa\\Ruler](https://github.com/hoaproject/Ruler) library.

Roadmap
=======

[](#roadmap)

- Create dynamically Propositions via a Form and persist them on storage.
- Dynamics inferences

Configuration
=============

[](#configuration)

```
rezzza_ruler:
    context_builder: service.id
    # or
    #context_builder:
    #    default: service.id
    events:
        event.cart.paid: 'Cart paid'
        # or
        event.cart.paid:
            label: 'Cart paid'
            context_builder: default
    inferences:
        cart.price_total:
            # This will show this inferences only when event event.cart.paid
            # will be selected on UI.
            # This is optional.
            event:       [event.cart.paid]
            type:        decimal
            description: Cart total price is
        cart.created_at:
            type:        date
            description: Cart was created at
        cart.contain_product:
            type:        product
            # Your own type
            # You'll return a list of product as array.
            # Not yet implemented, we'll have to finish ui via forms.
            description: Cart contain product
```

Usage
=====

[](#usage)

```
