src/Twig/Extension/PageExtension.php
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);
    }
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);
    }
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 ) ; }
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
Returns the URL for an ajax request for given block .