This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Components/Form/RadioField.php

33 lines
894 B
PHP
Raw Normal View History

<?php
namespace Symfony\Components\Form;
use Symfony\Components\Form\Renderer\InputCheckboxRenderer;
use Symfony\Components\Form\ValueTransformer\BooleanToStringTransformer;
/*
* This file is part of the symfony package.
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* A radio field for selecting boolean values.
*
* @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
*/
class RadioField extends ToggleField
{
/**
* {@inheritDoc}
*/
public function render(array $attributes = array())
{
return parent::render(array_merge(array(
'type' => 'radio',
'name' => $this->getParent() ? $this->getParent()->getName() : $this->getName(),
), $attributes));
}
}