Commit 973da34b authored by Taylor Otwell's avatar Taylor Otwell

Pass directory into View:: file method.

parent 263d6145
...@@ -92,7 +92,7 @@ Autoloader::directories(array( ...@@ -92,7 +92,7 @@ Autoloader::directories(array(
Event::listen(View::loader, function($bundle, $view) Event::listen(View::loader, function($bundle, $view)
{ {
return View::file($bundle, $view); return View::file($bundle, $view, path('app').'views');
}); });
/* /*
......
...@@ -132,20 +132,21 @@ class View implements ArrayAccess { ...@@ -132,20 +132,21 @@ class View implements ArrayAccess {
* *
* @param string $bundle * @param string $bundle
* @param string $view * @param string $view
* @param string $directory
* @return string * @return string
*/ */
public static function file($bundle, $view) public static function file($bundle, $view, $directory)
{ {
$root = Bundle::path($bundle).'views/'; $directory = str_finish($directory, DS);
// Views may have either the default PHP fiel extension of the "Blade" // Views may have either the default PHP file extension of the "Blade"
// extension, so we will need to check for both in the view path // extension, so we will need to check for both in the view path
// and return the first one we find for the given view. // and return the first one we find for the given view.
if (file_exists($path = $root.$view.EXT)) if (file_exists($path = $directory.$view.EXT))
{ {
return $path; return $path;
} }
elseif (file_exists($path = $root.$view.BLADE_EXT)) elseif (file_exists($path = $directory.$view.BLADE_EXT))
{ {
return $path; return $path;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment