original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Renders content by given slug.
  
  @param string      $slug
  @param bool|string $template
  
  @return string
docstring_tokens: Renders content by given slug .