Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RoutableFragmentRenderer.php

class RoutableFragmentRenderer

Adds the possibility to generate a fragment URI for a given Controller.

@author Fabien Potencier <fabien@symfony.com>

Hierarchy

  • class \Symfony\Component\HttpKernel\Fragment\RoutableFragmentRenderer implements \Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface

Expanded class hierarchy of RoutableFragmentRenderer

File

vendor/symfony/http-kernel/Fragment/RoutableFragmentRenderer.php, line 23

Namespace

Symfony\Component\HttpKernel\Fragment
View source
abstract class RoutableFragmentRenderer implements FragmentRendererInterface {
    
    /**
     * @internal
     */
    protected string $fragmentPath = '/_fragment';
    
    /**
     * Sets the fragment path that triggers the fragment listener.
     *
     * @see FragmentListener
     */
    public function setFragmentPath(string $path) : void {
        $this->fragmentPath = $path;
    }
    
    /**
     * Generates a fragment URI for a given controller.
     *
     * @param bool $absolute Whether to generate an absolute URL or not
     * @param bool $strict   Whether to allow non-scalar attributes or not
     */
    protected function generateFragmentUri(ControllerReference $reference, Request $request, bool $absolute = false, bool $strict = true) : string {
        return (new FragmentUriGenerator($this->fragmentPath))
            ->generate($reference, $request, $absolute, $strict, false);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overrides
FragmentRendererInterface::getName public function Gets the name of the strategy. 4
FragmentRendererInterface::render public function Renders a URI and returns the Response content. 3
RoutableFragmentRenderer::$fragmentPath protected property @internal
RoutableFragmentRenderer::generateFragmentUri protected function Generates a fragment URI for a given controller.
RoutableFragmentRenderer::setFragmentPath public function Sets the fragment path that triggers the fragment listener.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal