Fix bug where error is shown when named view isn't set.

Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>
This commit is contained in:
Jason Lewis
2012-06-16 10:29:45 +09:30
parent 5d6258a7b4
commit a5cc8616fc

View File

@@ -118,9 +118,9 @@ class View implements ArrayAccess {
*/ */
public static function exists($view, $return_path = false) public static function exists($view, $return_path = false)
{ {
if(starts_with($view, 'name: ')) if (starts_with($view, 'name: ') and array_key_exists($name = substr($view, 6), static::$names))
{ {
$view = static::$names[substr($view, 6)]; $view = static::$names[$name];
} }
list($bundle, $view) = Bundle::parse($view); list($bundle, $view) = Bundle::parse($view);