public function snippetFunction(
        $slug,
        $template = null
    ) {
        $result = null;
        if ($this->handler && $this->router) {
            $route = $this->router->generate(
                '_ongr_plain_cms_snippet',
                [
                    'slug' => $slug,
                    'template' => $template,
                ]
            );
            try {
                $result = $this->handler->render($route, $this->renderStrategy);
            } catch (\InvalidArgumentException $ex) {
                // ESI is disabled.
                $result = $this->handler->render($route);
            }
        }

        return $result;
    }
public function snippetFunction(
        $slug,
        $template = null
    ) {
        $result = null;
        if ($this->handler && $this->router) {
            $route = $this->router->generate(
                '_ongr_plain_cms_snippet',
                [
                    'slug' => $slug,
                    'template' => $template,
                ]
            );
            try {
                $result = $this->handler->render($route, $this->renderStrategy);
            } catch (\InvalidArgumentException $ex) {
                // ESI is disabled.
                $result = $this->handler->render($route);
            }
        }

        return $result;
    }
public function snippetFunction ( $ slug , $ template = null ) { $ result = null ; if ( $ this -> handler && $ this -> router ) { $ route = $ this -> router -> generate ( '_ongr_plain_cms_snippet' , [ 'slug' => $ slug , 'template' => $ template , ] ) ; try { $ result = $ this -> handler -> render ( $ route , $ this -> renderStrategy ) ; } catch ( \ InvalidArgumentException $ ex ) { // ESI is disabled. $ result = $ this -> handler -> render ( $ route ) ; } } return $ result ; }
Renders content by given slug.

@param string      $slug
@param bool|string $template

@return string
Renders content by given slug .