From 5d6258a7b40afd1739911c4f7aa350f456b9450f Mon Sep 17 00:00:00 2001 From: Jason Lewis Date: Fri, 15 Jun 2012 10:29:09 +0930 Subject: [PATCH 1/2] Can now check for existance of named views. Signed-off-by: Jason Lewis --- laravel/view.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/laravel/view.php b/laravel/view.php index f97b3dee..b4304889 100644 --- a/laravel/view.php +++ b/laravel/view.php @@ -118,6 +118,11 @@ public function __construct($view, $data = array()) */ public static function exists($view, $return_path = false) { + if(starts_with($view, 'name: ')) + { + $view = static::$names[substr($view, 6)]; + } + list($bundle, $view) = Bundle::parse($view); $view = str_replace('.', '/', $view); From a5cc8616fcfa2c1b5f5066cc76cc3f690303f31a Mon Sep 17 00:00:00 2001 From: Jason Lewis Date: Sat, 16 Jun 2012 10:29:45 +0930 Subject: [PATCH 2/2] Fix bug where error is shown when named view isn't set. Signed-off-by: Jason Lewis --- laravel/view.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/laravel/view.php b/laravel/view.php index b4304889..9a375073 100644 --- a/laravel/view.php +++ b/laravel/view.php @@ -118,9 +118,9 @@ public function __construct($view, $data = array()) */ 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);