Form field local path.

@param Request $request

@return Response
487435
public function localPathAction(Request $request)
    {
        $response = $this->getCacheTimeKeeper()->getResponse();
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        $form = $this->createForm(
            new ChoiceLocalPath(),
            ['path' => $request->get('path') ?: '']
        );

        return $this->render('AnimeDbAppBundle:Form:local_path.html.twig', [
            'form' => $form->createView(),
        ], $response);
    }
481486
public function retrieveFormFieldElementAction(Request $request)
    {
        $action = new RetrieveFormFieldElementAction($this->twig, $this->pool, $this->helper);

        return $action($request);
    }
185143
public function upload(Request $request)
    {
        try {
            $path = $request->file->store($request->upload_path, $this->filesystem);
            $success = true;
            $message = 'Successfully uploaded new file!';
        } catch (Exception $e) {
            $success = false;
            $message = $e->getMessage();
        }

        $realPath = Storage::disk($this->filesystem)->getDriver()->getAdapter()->getPathPrefix().$path;
        Image::make($realPath)->orientate()->save();

        $path = preg_replace('/^public\//', '', $path);

        return response()->json(compact('success', 'message', 'path'));
    }
784719
public function createAction(Request $request)
    {
        $this->denyAccessUnlessGranted('ROLE_ADMIN');

        $locale = new Locale();

        $form = $this->createForm(new LocaleType(), $locale);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($locale);
            $em->flush();

            $this->addFlash('success', 'Locale has been created successfully');

            return $this->redirectToRoute('opifer_cms_locale_edit', ['id' => $locale->getId()]);
        }

        return $this->render('OpiferCmsBundle:Backend/Locale:create.html.twig', [
            'locale' => $locale,
            'form' => $form->createView()
        ]);
    }
1054765
protected function determineZone(Request $request)
    {
        if ($request->isXmlHttpRequest() || $this->isPathApplicable($request, Zone::ASYNC)) {
            return Zone::ASYNC;
        } elseif ($this->isPathApplicable($request, Zone::BACKEND)) {
            return Zone::BACKEND;
        }

        return Zone::FRONTEND;
    }
933915
public function postAction(Request $request)
    {
        $document = $this->documentManager->create(Structure::TYPE_SNIPPET);
        $form = $this->processForm($request, $document);

        return $this->handleView($form->getData());
    }
498371
private function getTraceKey(Request $request): string
    {
        $path = $request->getPathInfo();
        if ($qs = $request->getQueryString()) {
            $path .= '?'.$qs;
        }

        return $request->getMethod().' '.$path;
    }
1298692
public function get_dir(Request $request)
    {

        $root = base_path() . DIRECTORY_SEPARATOR;
        $postDir = rawurldecode(base_path($request->get('dir')));

        if (file_exists($postDir))
        {
            $files = scandir($postDir);
            $returnDir = substr($postDir, strlen($root));
            natcasesort($files);

            if (count($files) > 2)
            { // The 2 accounts for . and ..
                echo "<ul class='jqueryFileTree'>";
                foreach ($files as $file)
                {
                    $htmlRel = htmlentities($returnDir . $file);
                    $htmlName = htmlentities($file);
                    $ext = preg_replace('/^.*\./', '', $file);
                    if (file_exists($postDir . $file) && $file != '.' && $file != '..')
                    {
                        if (is_dir($postDir . $file))
                        {
                            echo "<li class='directory collapsed'><a rel='" . $htmlRel . "/'>" . $htmlName . "</a></li>";
                        }
                        else
                        {
                            echo "<li class='file ext_{$ext}'><a rel='" . $htmlRel . "'>" . $htmlName . "</a></li>";
                        }
                    }
                }
                echo "</ul>";
            }
        }
    }
1153186
public function fieldsAction(Request $request)
    {
        return $this->handleView(
            $this->view(
                array_values(
                    array_diff_key(
                        $this->getProductVariantManager()->retrieveFieldDescriptors($this->getLocale($request)),
                        [
                            'statusId' => false,
                            'categoryIds' => false,
                        ]
                    )
                ),
                200
            )
        );
    }
745442
public function getFieldsAction(Request $request)
    {
        $locale = $request->get('locale');

        return $this->handleView(
            $this->view(
                array_values($this->getManager()->getFieldDescriptors($locale))
            )
        );
    }
484873
protected function createLoginPath(Request $request)
    {
        $url = $this->loginPath;
        $url .= $this->appendNextUrl($request) ?  '?'. self::NEXT_URL_PARAMETER . '=' . $request->getPathInfo() : '';

        return $url;
    }
666576
public function cgetAction(Request $request)
    {
        $locale = $this->getRequestParameter($request, 'locale', true);
        $fieldDescriptors = $this->getFieldDescriptors($locale, false);
        $types = array_filter(explode(',', $request->get('types')));
        $listBuilder = $this->getListBuilder($request, $fieldDescriptors, $types);
        $listBuilder->setParameter('locale', $locale);
        $listResponse = $listBuilder->execute();
        $count = $listBuilder->count();

        for ($i = 0, $length = count($listResponse); $i < $length; ++$i) {
            $format = $this->getFormatManager()->getFormats(
                $listResponse[$i]['id'],
                $listResponse[$i]['name'],
                $listResponse[$i]['storageOptions'],
                $listResponse[$i]['version'],
                $listResponse[$i]['subVersion'],
                $listResponse[$i]['mimeType']
            );

            if (0 < count($format)) {
                $listResponse[$i]['thumbnails'] = $format;
            }

            $listResponse[$i]['url'] = $this->getMediaManager()->getUrl(
                $listResponse[$i]['id'],
                $listResponse[$i]['name'],
                $listResponse[$i]['version']
            );
        }

        $ids = $listBuilder->getIds();
        if (null != $ids) {
            $result = [];
            foreach ($listResponse as $item) {
                $result[array_search($item['id'], $ids)] = $item;
            }
            ksort($result);
            $listResponse = array_values($result);
        }

        $list = new ListRepresentation(
            $listResponse,
            self::$entityKey,
            'cget_media',
            $request->query->all(),
            $listBuilder->getCurrentPage(),
            $listBuilder->getLimit(),
            $count
        );

        $view = $this->view($list, 200);

        return $this->handleView($view);
    }
727596
public function createAction(Request $request)
        {

            $oRemoteApp = new RemoteApp();
            $form       = $this->createCreateForm($oRemoteApp);
            $form->handleRequest($request);

            if ($form->isValid()) {

                $sDomain = $oRemoteApp->getDomain();
                if(substr($sDomain,-1,1) !== "/"){
                    $sDomain .= "/";
                    $oRemoteApp->setDomain($sDomain);
                }

                $sModulePath = $oRemoteApp->getApiUrl();
                if(substr($sModulePath,0,1) === "/"){
                    $sModulePath = substr($sModulePath,1);
                    $oRemoteApp->setApiUrl($sModulePath);
                }

                $oRemoteApp->save();

                return $this->redirect($this->generateUrl('remote_app'));
            }

            return $this->render('SlashworksAppBundle:RemoteApp:new.html.twig', array(
                'entity' => $oRemoteApp,
                'form'   => $form->createView(),
            ));
        }
650266
public function index(Request $request)
    {
        $currentPath = $request->get('path');
        $dir         = storage_path('app/public/' . $currentPath);
        $imageFiles  = $this->getImageFiles($dir);

        foreach (Finder::create()->in($dir)->sortByType()->directories() as $file) {
            $imageFiles->name($file->getBaseName());
        }

        $files = new Collection;
        $parts = explode('/', $currentPath);
        array_pop($parts);
        if ($parts <> '' && $currentPath <> '') {
            $files->push([
                'name'    => '.. Up',
                'relPath' => implode('/', $parts),
                'type'    => 'dir',
                'url'     => \Storage::url($currentPath),
            ]);
        }

        foreach ($imageFiles as $file) {
            $path = str_replace(storage_path('app/public/'), '', $file->getRealPath());
            $files->push([
                'name'    => $file->getFilename(),
                'relPath' => $path,
                'type'    => $file->getType(),
                'url'     => \Storage::url($path),
            ]);
        }

        return response()->json($files->groupBy('type'));
    }
490926
public function fieldsAction(Request $request)
    {
        $locale = $this->getLocale($request);

        // default contacts list
        return $this->handleView($this->view(array_values($this->getManager()->getFieldDescriptors($locale)), 200));
    }
1220474
public function trashAction(Request $request): Response
    {
        $form = $this->formFactory->trashLocation(
            new LocationTrashData()
        );

        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (LocationTrashData $data) {
                return $this->handleTrashLocationForm($data);
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        return $this->redirect($this->generateUrl('ezplatform.trash.list'));
    }
381088
public function getFieldsAction(Request $request)
    {
        return $this->handleView(
            $this->view(array_values($this->getManager()->getFieldDescriptors($this->getLocale($request))))
        );
    }