Networking\InitCmsBundle\Controller\PageAdminController::getPathAction PHP Method

getPathAction() public method

Return a json array with the calculated path for a page object
public getPathAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response
    public function getPathAction(Request $request)
    {
        $id = $request->get('page_id');
        $getPath = $request->get('path');
        $object = $this->admin->getObject($id);
        if ($id && $object) {
            $path = $object->getFullPath();
        } else {
            $path = '/';
        }
        $getPath = Urlizer::urlize($getPath);
        return $this->renderJson(array('path' => $path . $getPath));
    }