Example #1
0
 /**
  * Renders a partial template.
  *
  * @param string $file      A relative file path to the template.
  * @param array  $variables An associative array of variable that should be available
  *                          to the rendered template.
  * @param bool   $merge     A boolean value indicating if current variable table should be
  *                          merged into the partial template.
  *
  * @return string
  */
 public function partial(string $file, array $variables = [], bool $merge = false) : string
 {
     if ($merge) {
         $variables = new VariableBucket(array_merge($this->variables->all(), $variables));
     } else {
         $variables = new VariableBucket($variables);
     }
     return $this->engine->render($file, $this->sections, $variables, $this->attributes);
 }