I got a table in data base ID, json, status and everything works in another table and in this one I can save, read but can not take the data from repository and pass to form. Look:
that's my SliderType Form
class SliderType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('status', ChoiceType::class, array(
'data' => $options['status'],
'choices' => array(
"Aktywna" => 1,
"Nieaktywna" => 0
),
'attr' => array(
'class' => 'form-control'
),
))
And here I need to pass from options resolver a status variable which is boolean, so in controller I done it look:
//tworzymy formularz
$form = $this->createForm(SliderType::class, $request, array(
.
.
'status' => $slider->getStatus,
te problem is that another variables works perfect if i add only this i thrown a error:
Cannot read index "status" from object of type "Symfony\Component\HttpFoundation\Request" because it doesn't implement \ArrayAccess.
Any Idea what is wrong here? and the funny thing is that I got another controller with another table (structure the same) and all works fine.