Merge pull request #819 from jasonlewis/patch-11

Allow checking of named view existance.
This commit is contained in:
Taylor Otwell 2012-06-20 09:49:12 -07:00
commit 6405175dbd
1 changed files with 5 additions and 0 deletions

View File

@ -118,6 +118,11 @@ public function __construct($view, $data = array())
*/ */
public static function exists($view, $return_path = false) public static function exists($view, $return_path = false)
{ {
if (starts_with($view, 'name: ') and array_key_exists($name = substr($view, 6), static::$names))
{
$view = static::$names[$name];
}
list($bundle, $view) = Bundle::parse($view); list($bundle, $view) = Bundle::parse($view);
$view = str_replace('.', '/', $view); $view = str_replace('.', '/', $view);