/** * Find the real path * * @param [type] $path * @param [type] &$includedViews * @return [type] */ public function openViewPath($path) { try { $realpath = $this->finder->find($path); return $this->file->get($realpath); } catch (\Exception $e) { // we just return an empty string, we are going to passively fail // here because it is not always possible to search inside of // the @include(...) view path, for example, what if it was // @include ($somevar . '_item') there is no way to find this // view without first rendering the page } return ''; }
public static function make($view, array $parameters = array()) { $ci2 =& get_instance(); $ci2->config->load('blade', true); // Get paths from configuration $viewsPaths = $ci2->config->item('views_paths', 'blade'); $cachePath = $ci2->config->item('cache_path', 'blade'); // Create the file system objects $fileSystem = new Illuminate\Filesystem\Filesystem(); $fileFinder = new Illuminate\View\FileViewFinder($fileSystem, $viewsPaths); // Create the Blade engine and register it $bladeEngine = new Illuminate\View\Engines\CompilerEngine(new Illuminate\View\Compilers\BladeCompiler($fileSystem, $cachePath)); $engineResolver = new Illuminate\View\Engines\EngineResolver(); $engineResolver->register('blade', function () use($bladeEngine) { return $bladeEngine; }); // Create the environment object $environment = new Illuminate\View\Environment($engineResolver, $fileFinder, new Illuminate\Events\Dispatcher()); // Create the view // Orig is return I change it to echo echo new Illuminate\View\View($environment, $bladeEngine, $view, $fileFinder->find($view), $parameters); }