[Form] Fix BC break introduced in #14050
This commit is contained in:
parent
607dedde35
commit
f3dbb5dea2
|
@ -13,7 +13,7 @@ namespace Symfony\Bridge\Twig\Extension;
|
|||
|
||||
use Symfony\Bridge\Twig\TokenParser\FormThemeTokenParser;
|
||||
use Symfony\Bridge\Twig\Form\TwigRendererInterface;
|
||||
use Symfony\Component\Form\ChoiceList\View\ChoiceView;
|
||||
use Symfony\Component\Form\Extension\Core\View\ChoiceView;
|
||||
|
||||
/**
|
||||
* FormExtension extends Twig with form capabilities.
|
||||
|
|
|
@ -11,12 +11,14 @@
|
|||
|
||||
namespace Symfony\Component\Form\ChoiceList\View;
|
||||
|
||||
use Symfony\Component\Form\Extension\Core\View\ChoiceView as LegacyChoiceView;
|
||||
|
||||
/**
|
||||
* Represents a choice in templates.
|
||||
*
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
class ChoiceView
|
||||
class ChoiceView extends LegacyChoiceView
|
||||
{
|
||||
/**
|
||||
* The label displayed to humans.
|
||||
|
|
|
@ -11,18 +11,37 @@
|
|||
|
||||
namespace Symfony\Component\Form\Extension\Core\View;
|
||||
|
||||
use Symfony\Component\Form\ChoiceList\View\ChoiceView as BaseChoiceView;
|
||||
|
||||
/**
|
||||
* Represents a choice in templates.
|
||||
*
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*
|
||||
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
|
||||
* Use {@link BaseChoiceView} instead.
|
||||
* Use {@link \Symfony\Component\Form\ChoiceList\View\ChoiceView} instead.
|
||||
*/
|
||||
class ChoiceView extends BaseChoiceView
|
||||
class ChoiceView
|
||||
{
|
||||
/**
|
||||
* The original choice value.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
public $data;
|
||||
|
||||
/**
|
||||
* The view representation of the choice.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $value;
|
||||
|
||||
/**
|
||||
* The label displayed to humans.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* Creates a new ChoiceView.
|
||||
*
|
||||
|
@ -32,7 +51,9 @@ class ChoiceView extends BaseChoiceView
|
|||
*/
|
||||
public function __construct($data, $value, $label)
|
||||
{
|
||||
parent::__construct($label, $value, $data);
|
||||
$this->data = $data;
|
||||
$this->value = $value;
|
||||
$this->label = $label;
|
||||
|
||||
trigger_error('The '.__CLASS__.' class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\View\ChoiceView instead.', E_USER_DEPRECATED);
|
||||
}
|
||||
|
|
Reference in New Issue