コード例 #1
0
 /**
  * This function will be called when rendering a module. By default a
  * template is required, and it will be rendered using the results from
  * the toTwig() function.
  *
  * @param Template|null $template
  * @return string    The content generated by the module.
  */
 public function showFront(Template $template = NULL)
 {
     if (!$template) {
         throw new \Exception('A template is required for this module (' . get_class($this) . ').');
     }
     return $template->render($this->toTwig());
 }
コード例 #2
0
ファイル: Code.php プロジェクト: bombayworks/currycms
 /** {@inheritdoc} */
 public function showFront(Template $template = null)
 {
     $twig = $this->toTwig();
     return $template ? $template->render($twig) : $twig['content'];
 }