Merge branch 'develop' of github.com:laravel/laravel into develop

This commit is contained in:
Taylor Otwell 2012-04-17 20:11:08 -05:00
commit 42f8914611
1 changed files with 20 additions and 5 deletions

View File

@ -110,12 +110,12 @@ public function __construct($view, $data = array())
}
/**
* Get the path to a given view on disk.
*
* @param string $view
* @return string
* Allows people to check if a view passed in exists, handy for certain types of CMS development
* @param string $view The view name (ex. site.home)
* @param boolean $return_path Setting to TRUE will return the path found if it exists
* @return string / boolean
*/
protected function path($view)
public static function exists($view, $return_path = false)
{
list($bundle, $view) = Bundle::parse($view);
@ -127,6 +127,21 @@ protected function path($view)
$path = Event::first(static::loader, array($bundle, $view));
if ( ! is_null($path))
{
return $return_path ? $path : true;
}
return false;
}
/**
* Get the path to a given view on disk.
*
* @param string $view
* @return string
*/
protected function path($view)
{
if ($path = $this->exists($view,true))
{
return $path;
}