Returns the URL for an ajax request for given block.

@param PageBlockInterface $block      Block service
@param array              $parameters Provide absolute or relative url ?
@param bool               $absolute

@return string
358510
public function ajaxUrl(PageBlockInterface $block, $parameters = [], $absolute = UrlGeneratorInterface::ABSOLUTE_PATH)
    {
        $parameters['blockId'] = $block->getId();

        if ($block->getPage() instanceof PageInterface) {
            $parameters['pageId'] = $block->getPage()->getId();
        }

        return $this->router->generate('sonata_page_ajax_block', $parameters, $absolute);
    }
1155525
public function show(ReadBlockInterface $block)
    {
        $formParameters = array('method' => 'GET');

        if ('' != $block->getAttribute('contentNodeId')) {
            $language = $this->currentSiteManager->getSiteLanguage();
            $siteId = $this->currentSiteManager->getSiteId();
            $nodeId = $this->nodeRepository->findOnePublished($block->getAttribute('contentNodeId'), $language, $siteId)->getId();
            $formParameters['action'] = $this->router->generate($nodeId);
        }

        $formData = $this->requestStack->getCurrentRequest()->get('elastica_search');
        $form = $this->formFactory->create(new SearchType(), $formData, $formParameters);

        return $this->render('OpenOrchestraElasticaFrontBundle:Block/Search:show.html.twig', array(
            'form' => $form->createView(),
            'id' => $block->getId(),
            'class' => $block->getStyle(),
        ));
    }
257233
public function getAssembledUrl(
		array $parameters=[], bool $is_absolute = false, bool $force_tls = false
	) :string {
		// declare a variable for the assembled url
		$url = $this->url;
		// for each of this url's possible parameters
		foreach($this->indexedParameters as $index => $parameter_name) {
			// if a replacement value has been provided
			$replacement = isset($parameters[$parameter_name]) ? $parameters[$parameter_name] . '/' : '';
			// replace with the value in the url, or remove the parameter placeholder
			$url = str_replace([":{$parameter_name}/",'{'.$parameter_name.'}'] , $replacement , $url);
		}
		// return the assembled route with an absolute prefix if necessary
		return $is_absolute ? Route\Helper::prefixIt($url, $force_tls) : $url;

	}
701812
public function getLpPath(NestedSetRoutingPageInterface $page, $action, $parameters = array(), $relative = false)
    {
        $configuration = $this->routeConfiguration->get($action);

        return $this->opGenerator->generate(
            $configuration->getPageRouteName($page),
            $parameters,
            $relative ? UrlGeneratorInterface::RELATIVE_PATH : UrlGeneratorInterface::ABSOLUTE_PATH
        );
    }
387823
public function getNewsIndexPermalink(array $parameters = [], $absolute = 1)
    {
        return $this->getContainer()->get('router')->generate($this->getNewsIndexRoute(), $this->getNewsIndexRouteParameters($parameters), $absolute);
    }
1070789
public function route($name, array $params = [], $absolute = false)
    {
        $route = $this->router->route($name, $params);
        return $absolute
            ? $this->request->getSchemeAndHttpHost() . $route
            : $route;
    }
1101528
public static function getParentForm(BlockInterface $block)
    {
        $form = $block->getForm();

        if (null !== $form) {
            return $form;
        }

        return null !== $block->getParent()
            ? static::getParentForm($block->getParent())
            : null;
    }
987453
public function renderBlock(BlockInterface $block, $arguments = array())
    {
        /** @var BlockManager $manager */
        $manager = $this->container->get('opifer.content.block_manager');

        $service = $manager->getService($block);

        if ($this->blockEnvironment->getBlockMode($block) == 'manage') {
            $content =  $service->setEnvironment($this->blockEnvironment)->manage($block)->getContent();
//            $block->isRendered = true;
//
//            // TODO check for unrendered blocks
//            if ($block instanceof BlockContainerInterface) {
//                foreach ($block->getChildren() as $child) {
//                    if (!property_exists($child, 'isRendered') || $child->isRendered) {
//                        $content .= $manager->getService($child)->manage($child)->getContent();
//                    }
//                }
//            }

            return $content;
        }

        return $service->execute($block)->getContent();
    }
574727
public function action($action, $parameters = array(), $absolute = true)
    {

        if($path = $this->getPathFinder()->toControllerAction($action, $parameters)){

            if(!$absolute){
                return $path;
            }

            return $this->to($path);
        }

        return parent::action($action, $parameters, $absolute);

    }
595819
protected function generateUrl(array $urlParameters = array(), $absolute = false)
    {
        $url = $this->getCustomUrl($urlParameters);
        if ($url)
        {
            return $url;
        }

        return $this->generateStandardUrl($urlParameters);
    }
1063323
public static function absoluteURLs($html)
    {
        $html = str_replace('$CurrentPageURL', Controller::curr()->getRequest()->getURL(), $html);
        return HTTP::urlRewriter($html, function ($url) {
            //no need to rewrite, if uri has a protocol (determined here by existence of reserved URI character ":")
            if (preg_match('/^\w+:/', $url)) {
                return $url;
            }
            return Director::absoluteURL($url, true);
        });
    }
1288016
public function getViewParameters(BlockInterface $block)
    {
        $parameters = [
            'block_service' => $this,
            'block' => $block,
            'children' => $this->getEnvironment() ? $this->getEnvironment()->getBlockChildren($block) : [],
        ];

        return $parameters;
    }
265207
public function checkAction( $action, $parameters = array(), $absolute = true )
  {
    try {
      $url = $this->_app['url']->action($action, $parameters, $absolute);
    } catch( InvalidArgumentException $e ) {
      return false;
    }

    return $url;
  }
39628
protected function getAbsoluteUrl($route, array $parameters = [], $useRequest = false)
    {
        $request = $this->getContext()->getRequest();

        return $request->getScheme() . '://' . $request->getHost() . $this->getUrl($route, $parameters, $useRequest);
    }
405644
public function viewUrl($viewName, array $parameters = array())
    {
        $path = sprintf("?view=%s", $viewName);

        return $this->absoluteUrl($path, $parameters);
    }
143006
public function transform($block, array $params = array())
    {
        if (!$block instanceof BlockInterface) {
            throw new TransformerParameterTypeException();
        }
        $facade = $this->newFacade();

        $facade->component = $block->getComponent();
        $facade->name = $this->blockConfigurationManager->getBlockComponentName($block->getComponent());
        $facade->label = $block->getLabel();
        $facade->style = $block->getStyle();
        $facade->id = $block->getId();
        $facade->language = $block->getLanguage();
        $facade->transverse = $block->isTransverse();
        $facade->updatedAt = $block->getUpdatedAt();
        $categoryKey = $this->blockConfigurationManager->getBlockCategory($block->getComponent());
        $facade->category = array(
            'label' => $this->translator->trans($categoryKey),
            'key' => $categoryKey
        );

        foreach ($block->getAttributes() as $key => $attribute) {
            if (is_array($attribute)) {
                $attribute = json_encode($attribute);
            }
            $facade->addAttribute($key, $attribute);
        }

        $facade->previewContent = $this->displayBlockManager->show($block);

        if ($this->hasGroup(CMSGroupContext::BLOCKS_NUMBER_USE)) {
            $facade->numberUse = $this->nodeRepository->countBlockUsed($block->getId());
        }

        if ($this->hasGroup(CMSGroupContext::BLOCK_REQUIRED_URI_PARAMETERS)) {
            $facade->requiredUriParameters = $this->generateFormManager->getRequiredUriParameter($block);
        }


        return $facade;
    }
1129819
public function url($route, $parameters = array())
    {
        return $this->silex['url_generator']->generate($route, $parameters, \Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL);
    }