Symfony form button as a link (ex. Cancel action).

v2.0.0 2016-09-03 03:42 UTC


This bundle provides an form extension for the button type to allow an HTML "" tag as a button. For example, a cancel link on a form.


1. Add the bundle to your composer.json

"require": {
    "symfonycontrib/link-button-bundle": "^2.0"

2. Install the bundle using composer

$ composer update symfonycontrib/link-button-bundle

3. Add this bundle to your application's kernel:

    new SymfonyContrib\Bundle\LinkButtonBundle\LinkButtonBundle(),

How to Use

To use, simply pass a URL to an url option of a form button.

** Example Form **

->add('cancel', 'button', [
    'url' => '/',