Location: PHPKode > projects > Silex > fabpot-Silex-960f097/src/Silex/Application/FormTrait.php
<?php

/*
 * This file is part of the Silex framework.
 *
 * (c) Fabien Potencier <hide@address.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Silex\Application;

use Symfony\Component\Form\FormBuilder;

/**
 * Form trait.
 *
 * @author Fabien Potencier <hide@address.com>
 */
trait FormTrait
{
    /**
     * Creates and returns a form builder instance
     *
     * @param mixed $data    The initial data for the form
     * @param array $options Options for the form
     *
     * @return FormBuilder
     */
    public function form($data = null, array $options = array())
    {
        return $this['form.factory']->createBuilder('form', $data, $options);
    }
}
Return current item: Silex