Sylius\Bundle\ProductBundle\Controller\ProductAttributeController::renderAttributeValueFormsAction PHP Method

renderAttributeValueFormsAction() public method

public renderAttributeValueFormsAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response
    public function renderAttributeValueFormsAction(Request $request)
    {
        $template = $request->attributes->get('template', 'SyliusAttributeBundle::attributeValueForms.html.twig');
        $form = $this->get('form.factory')->create(ProductAttributeChoiceType::class, null, ['multiple' => true]);
        $form->handleRequest($request);
        $attributes = $form->getData();
        foreach ($attributes as $attribute) {
            $forms[$attribute->getId()] = $this->getAttributeForm($attribute);
        }
        return $this->render($template, ['forms' => $forms, 'count' => $request->query->get('count'), 'metadata' => $this->metadata]);
    }