Extending Quotation Bundle Services

Introduction

You can extend the quotation bundle through Symfony's tagged services. To list some extensions to QuotationBundle, use the following console command:

php app/console klaro:quotation:services

NOTE: List might be incomplete!

Expression Evaluator

Expression evaluator is used in quotation phases when evaluating conditions or values. You can add variables to the default context by tagging a service with the name klaro_quotation.expression_context and pass a parameter variable that defines the name of the variable in the evaluation context.

For example, we want to use a helper service with the name helper inside phase condition expressions. Let's add a service for it and tag it with the name klaro_quotation.expression_context:

services:
    acme.phase_helper:
        class: Etc\AcmeBundle\PhaseHelper
        arguments: []
        tags:
            - { name: klaro_quotation.expression_context, variable: 'helper' }

Now you can use the service and call any methods on it, for example in a phase like this:

phaseItem:
    fieldName:        SomeField
    condition:        'helper.HasFeature(model) == true'

See also Configuration Objects.

Admin Pages

See Admin Pages.

Custom Phase Editor

See Form Phase Definition.

Custom Phase Items

See Phase Form Editor.

Output Documents

See Output Documents.

Summary Pages

See Summary Pages and Offering Summary.

Configuration Objects

See Configuration Objects.