Browse Source

[Templating] added an output() shorcut to the Engine class

Fabien Potencier 15 năm trước cách đây
mục cha
commit
768b5d0904
1 tập tin đã thay đổi với 13 bổ sung0 xóa
  1. 13 0
      src/Symfony/Components/Templating/Engine.php

+ 13 - 0
src/Symfony/Components/Templating/Engine.php

@@ -132,6 +132,19 @@ class Engine
     return $content;
   }
 
+  /**
+   * Outputs a rendered template.
+   *
+   * @param string $name       A template name
+   * @param array  $parameters An array of parameters to pass to the template
+   *
+   * @see render()
+   */
+  public function output($name, array $parameters = array())
+  {
+    echo $this->render($name, $parameters);
+  }
+
   /**
    * Gets a helper value.
    *