2017 © Pedro Pel├íez
 

symfony-bundle flow-bundle

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

image

sylius/flow-bundle

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  • Monday, July 25, 2016
  • by pjedrzejewski
  • Repository
  • 22 Watchers
  • 84 Stars
  • 886,992 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 42 Forks
  • 6 Open issues
  • 16 Versions
  • 4 % Grown

The README.md

SyliusFlowBundle Build status...

Multiple action processes with reusable steps for Symfony2 applications. Suitable for building checkouts or installations., (*1)

Note: This bundle is a prototype, it works only with latest Symfony., (*2)

Sylius

Sylius - Modern ecommerce for Symfony2. Visit Sylius.org., (*3)

Usage examples

<?php

namespace Acme\Bundle\CheckoutBundle\Process\Scenario;

use Acme\Bundle\CheckoutBundle\Process\Step;
use Sylius\Bundle\FlowBundle\Process\Builder\ProcessBuilderInterface;
use Sylius\Bundle\FlowBundle\Process\Scenario\ProcessScenarioInterface;

/**
 * My super checkout.
 *
 * @author Potato Potato <potato@potato.foo>
 */
class CheckoutScenario implements ProcessScenarioInterface
{
    /**
     * {@inheritdoc}
     */
    public function build(ProcessBuilderInterface $builder)
    {
        $builder
            ->add('security', new Step\SecurityStep())
            ->add('delivery', new Step\DeliveryStep())
            ->add('billing', 'acme_checkout_step_billing')
            ->add('finalize', new Step\FinalizeStep())
        ;
    }
}
<?php

namespace Acme\Bundle\CheckoutBundle\Process\Step;

use Acme\Bundle\CheckoutBundle\Entity\Address;
use Sylius\Bundle\FlowBundle\Process\Context\ProcessContextInterface;
use Sylius\Bundle\FlowBundle\Process\Step\AbstractContainerAwareStep;

/**
 * Delivery step.
 * Allows user to select delivery method for order.
 *
 * @author Potato Potato <potato@potato.foo>
 */
class DeliveryStep extends AbstractContainerAwareStep
{
    /**
     * {@inheritdoc}
     */
    public function displayAction(ProcessContextInterface $context)
    {
        // All data is stored in a separate session bag with parameter namespace support.
        $address = $context->getStorage()->get('delivery.address');
        $form = $this->createAddressForm($address);

        return $this->container->get('templating')->renderResponse('AcmeCheckoutBundle:Step:delivery.html.twig', array(
            'form'    => $form->createView(),
            'context' => $context
        ));
    }

    /**
     * {@inheritdoc}
     */
    public function forwardAction(ProcessContextInterface $context)
    {
        $request = $context->getRequest();
        $form = $this->createAddressForm();

        if ($form->handleRequest($request)->isValid()) {
            $context->getStorage()->set('delivery.address', $form->getData());

            return $this->complete();
        }

        // Form was not valid so we display the form again.
        return $this->container->get('templating')->renderResponse('AcmeCheckoutBundle:Step:delivery.html.twig', array(
            'form'    => $form->createView(),
            'context' => $context
        ));
    }

    /**
     * Create address form.
     *
     * @param Address $address
     *
     * @return FormInterface
     */
    private function createAddressForm(Address $address = null)
    {
        return $this->container->get('form.factory')->create('acme_checkout_address', $address);
    }
}

phpunit tests

bash $ composer install $ phpunit, (*4)

Documentation

Documentation is available on docs.sylius.org., (*5)

Code examples

If you want to see working implementation, try out the Sylius sandbox application., (*6)

Contributing

All informations about contributing to Sylius can be found on this page., (*7)

Mailing lists

Users

Questions? Feel free to ask on users mailing list., (*8)

Developers

To contribute and develop this bundle, use the developers mailing list., (*9)

Sylius twitter account

If you want to keep up with updates, follow the official Sylius account on twitter., (*10)

Bug tracking

This bundle uses GitHub issues. If you have found bug, please create an issue., (*11)

Versioning

Releases will be numbered with the format major.minor.patch., (*12)

And constructed with the following guidelines., (*13)

  • Breaking backwards compatibility bumps the major.
  • New additions without breaking backwards compatibility bumps the minor.
  • Bug fixes and misc changes bump the patch.

For more information on SemVer, please visit semver.org website. This versioning method is same for all Sylius bundles and applications., (*14)

MIT License

License can be found here., (*15)

Authors

The bundle was originally created by Paweł Jędrzejewski. See the list of contributors., (*16)

The Versions

25/07 2016

dev-master

9999999-dev http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation

24/05 2016

v0.19.0

0.19.0.0 http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation

18/05 2016

v0.18.0

0.18.0.0 http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation

29/01 2016

v0.17.0

0.17.0.0 http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation

11/01 2016

v0.16.0

0.16.0.0 http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation

05/08 2015

v0.15.0

0.15.0.0 http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation

16/03 2015

v0.14.0

0.14.0.0 http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation

05/01 2015

v0.13.0

0.13.0.0 http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation

27/10 2014

v0.12.0

0.12.0.0 http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation

30/09 2014

v0.11.0

0.11.0.0 http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation

24/06 2014

v0.10.0

0.10.0.0 http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation

10/04 2014

v0.9.0

0.9.0.0 http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation

03/03 2014

v0.8.0

0.8.0.0 http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation

28/01 2014

v0.7.0

0.7.0.0 http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation

24/11 2013

v0.6.0

0.6.0.0 http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation

24/10 2013

v0.5.0

0.5.0.0 http://sylius.org

Multiple action setups for Symfony2, build your checkouts/installers or whatever needs more than one step to complete.

  Sources   Download

MIT

The Requires

 

The Development Requires

flow checkout steps installation