From 973da34bc0d4fdee84ab8f5ff57984f48725ce99 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 26 Mar 2012 08:27:53 -0500 Subject: [PATCH] Pass directory into View:: file method. --- application/start.php | 2 +- laravel/view.php | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/application/start.php b/application/start.php index 518448a3..13e0dbf1 100644 --- a/application/start.php +++ b/application/start.php @@ -92,7 +92,7 @@ Event::listen(View::loader, function($bundle, $view) { - return View::file($bundle, $view); + return View::file($bundle, $view, path('app').'views'); }); /* diff --git a/laravel/view.php b/laravel/view.php index 9562d2e7..76d8d40d 100644 --- a/laravel/view.php +++ b/laravel/view.php @@ -132,20 +132,21 @@ protected function path($view) * * @param string $bundle * @param string $view + * @param string $directory * @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 // 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; } - elseif (file_exists($path = $root.$view.BLADE_EXT)) + elseif (file_exists($path = $directory.$view.BLADE_EXT)) { return $path; }