src/Phlexible/Bundle/MetaSetBundle/Controller/SetsController.php
public function fieldsAction(Request $request)
    {
        $id = $request->get('id');

        $metaSetManager = $this->get('phlexible_meta_set.meta_set_manager');
        $metaSet = $metaSetManager->find($id);
        $fields = $metaSet->getFields();

        $data = [];
        foreach ($fields as $field) {
            $data[] = [
                'id' => $field->getId(),
                'key' => $field->getName(),
                'type' => $field->getType(),
                'required' => $field->isRequired(),
                'synchronized' => $field->isSynchronized(),
                'readonly' => $field->isReadonly(),
                'options' => $field->getOptions(),
            ];
        }

        return new JsonResponse(['values' => $data]);
    }
public function fieldsAction(Request $request)
    {
        $id = $request->get('id');

        $metaSetManager = $this->get('phlexible_meta_set.meta_set_manager');
        $metaSet = $metaSetManager->find($id);
        $fields = $metaSet->getFields();

        $data = [];
        foreach ($fields as $field) {
            $data[] = [
                'id' => $field->getId(),
                'key' => $field->getName(),
                'type' => $field->getType(),
                'required' => $field->isRequired(),
                'synchronized' => $field->isSynchronized(),
                'readonly' => $field->isReadonly(),
                'options' => $field->getOptions(),
            ];
        }

        return new JsonResponse(['values' => $data]);
    }
public function fieldsAction ( Request $ request ) { $ id = $ request -> get ( 'id' ) ; $ metaSetManager = $ this -> get ( 'phlexible_meta_set.meta_set_manager' ) ; $ metaSet = $ metaSetManager -> find ( $ id ) ; $ fields = $ metaSet -> getFields ( ) ; $ data = [ ] ; foreach ( $ fields as $ field ) { $ data [ ] = [ 'id' => $ field -> getId ( ) , 'key' => $ field -> getName ( ) , 'type' => $ field -> getType ( ) , 'required' => $ field -> isRequired ( ) , 'synchronized' => $ field -> isSynchronized ( ) , 'readonly' => $ field -> isReadonly ( ) , 'options' => $ field -> getOptions ( ) , ] ; } return new JsonResponse ( [ 'values' => $ data ] ) ; }
List fields.

@param Request $request

@return JsonResponse
@Route("/fields", name="metasets_sets_fields")
List fields .