diff --git a/flight/Flight.php b/flight/Flight.php index 855a8d1..086df8b 100644 --- a/flight/Flight.php +++ b/flight/Flight.php @@ -518,9 +518,15 @@ class Flight { * * @param string $file Template file * @param array $data Template data + * @param string $key Key name */ - public static function _render($file, $data = null) { - self::view()->render($file, $data); + public static function _render($file, $data = null, $key = null) { + if ($key !== null) { + self::set($key, self::view()->fetch($file, $data)); + } + else { + self::view()->render($file, $data); + } } /**