/** * Ajax action for listing attributes * * @param Request $request * * @return \Symfony\Component\HttpFoundation\JsonResponse|\Symfony\Component\HttpFoundation\RedirectResponse */ public function ajaxIndexAction(Request $request) { if (!$request->isXmlHttpRequest()) { return $this->redirectToAction('index'); } $attributeGroupId = (int) $request->request->get('id'); return $this->jsonResponse(['attributes' => $this->manager->getAttributeSet($attributeGroupId)]); }