protected function createNewResourceForm(Context $context, $footer = true, array $options = [])
    {
        $resource = $context->getResource();

        $action = $this->generateResourcePath($resource, 'new');

        $form = $this->createForm($this->config->getFormType(), $resource, array_merge([
            'action' => $action,
            'method' => 'POST',
            'attr' => ['class' => 'form-horizontal form-with-tabs'],
            'admin_mode' => true,
            '_redirect_enabled' => true,
        ], $options));

        if ($footer) {
            $referer = $context->getRequest()->headers->get('referer');
            if (0 < strlen($referer) && false === strpos($referer, $action)) {
                $cancelPath = $referer;
            } else {
                if ($this->hasParent()) {
                    $cancelRoute = $this->getParent()->getConfiguration()->getRoute('show');
                } else {
                    $cancelRoute = $this->config->getRoute('list');
                }
                $cancelPath = $this->generateUrl($cancelRoute, $context->getIdentifiers());
            }

            $form->add('actions', 'form_actions', [
                'buttons' => [
                    'saveAndList' => [
                        'type' => 'submit',
                        'options' => [
                            'button_class' => 'primary',
                            'label' => 'ekyna_core.button.save_and_list',
                            'attr' => ['icon' => 'list'],
                        ],
                    ],
                    'save' => [
                        'type' => 'submit',
                        'options' => [
                            'button_class' => 'primary',
                            'label' => 'ekyna_core.button.save',
                            'attr' => ['icon' => 'ok'],
                        ],
                    ],
                    'cancel' => [
                        'type' => 'button',
                        'options' => [
                            'label' => 'ekyna_core.button.cancel',
                            'button_class' => 'default',
                            'as_link' => true,
                            'attr' => [
                                'class' => 'form-cancel-btn',
                                'icon' => 'remove',
                                'href' => $cancelPath,
                            ],
                        ],
                    ],
                ],
            ]);
        }

        return $form;
    }