public function component (GluggiFinder $finder, ComponentConfiguration $componentConfiguration, string $type, string $key)
    {
        try
        {
            $component = $finder->findComponent($type, $key);

            if (null === $component || $component->isHidden())
            {
                $message = null === $component
                    ? "No component found: '%s/%s'"
                    : "The component '%s/%s' has no single view.";

                throw $this->createNotFoundException(sprintf($message, $type, $key));
            }

            $template = $component->getType()->isIsolatedComponentViewMode()
                ? "isolatedComponent"
                : "component";

            return $this->render("@Gluggi/Gluggi/{$template}.html.twig", [
                "component" => $component,
                "type" => $component->getType(),
                "pageTitle" => [
                    $component->getName(),
                    $component->getType()->getName(),
                ],
                "templateConfiguration" => $componentConfiguration->getConfiguration($component),
            ]);
        }
        catch (UnknownComponentTypeException $e)
        {
            throw $this->createNotFoundException($e->getMessage(), $e);
        }
    }
public function component (GluggiFinder $finder, ComponentConfiguration $componentConfiguration, string $type, string $key)
    {
        try
        {
            $component = $finder->findComponent($type, $key);

            if (null === $component || $component->isHidden())
            {
                $message = null === $component
                    ? "No component found: '%s/%s'"
                    : "The component '%s/%s' has no single view.";

                throw $this->createNotFoundException(sprintf($message, $type, $key));
            }

            $template = $component->getType()->isIsolatedComponentViewMode()
                ? "isolatedComponent"
                : "component";

            return $this->render("@Gluggi/Gluggi/{$template}.html.twig", [
                "component" => $component,
                "type" => $component->getType(),
                "pageTitle" => [
                    $component->getName(),
                    $component->getType()->getName(),
                ],
                "templateConfiguration" => $componentConfiguration->getConfiguration($component),
            ]);
        }
        catch (UnknownComponentTypeException $e)
        {
            throw $this->createNotFoundException($e->getMessage(), $e);
        }
    }
public function component ( GluggiFinder $ finder , ComponentConfiguration $ componentConfiguration , string $ type , string $ key ) { try { $ component = $ finder -> findComponent ( $ type , $ key ) ; if ( null === $ component || $ component -> isHidden ( ) ) { $ message = null === $ component ? "No component found: '%s/%s'" : "The component '%s/%s' has no single view." ; throw $ this -> createNotFoundException ( sprintf ( $ message , $ type , $ key ) ) ; } $ template = $ component -> getType ( ) -> isIsolatedComponentViewMode ( ) ? "isolatedComponent" : "component" ; return $ this -> render ( "@Gluggi/Gluggi/{$template}.html.twig" , [ "component" => $ component , "type" => $ component -> getType ( ) , "pageTitle" => [ $ component -> getName ( ) , $ component -> getType ( ) -> getName ( ) , ] , "templateConfiguration" => $ componentConfiguration -> getConfiguration ( $ component ) , ] ) ; } catch ( UnknownComponentTypeException $ e ) { throw $ this -> createNotFoundException ( $ e -> getMessage ( ) , $ e ) ; } }
Renders a component in single view

@param GluggiFinder           $finder
@param ComponentConfiguration $componentConfiguration
@param string                 $type
@param string                 $key

@return Response
Renders a component in single view