Use blade package as standalone


#1

Hello everyone,

I want to use the blade package from laravel as a standalone in my own project.
But I can’t seem to get it working.

Hopefully somebody can help me here.
Here is my code :

<?php public function loadBlade($view, $viewPath = false, $data = array() ) { echo $this->viewPath; if(isset($viewPath)) { $this->viewPath = $viewPath; } $FileViewFinder = new FileViewFinder( new Filesystem, $this->viewPath ); $PhpEngine = new PhpEngine(); $PhpEngine->get($this->viewPath, $data); $dispatcher = new Dispatcher(new Container); $factory = new Factory( new EngineResolver, $FileViewFinder, $dispatcher ); $view = new View( $factory, $PhpEngine, $view, $this->viewPath, $data ); return $factory; } ?>

And here is the error code I get :

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'View [hello.php] not found.' in /system/vendor/illuminate/view/FileViewFinder.php:146 Stack trace: :0 /system/vendor/illuminate/view/FileViewFinder.php(83): Illuminate\View\FileViewFinder->findInPaths('hello.php', Array) :1 /system/vendor/illuminate/view/Factory.php(125): Illuminate\View\FileViewFinder->find('hello.php') :2 /application/controllers/home.controller.php(27): Illuminate\View\Factory->make('hello.php', 'application/vie...') :3 [internal function]: Home->index(Array) :4 /test/Bootstrap.php(42): call_user_func_array(Array, Array) :5 /test/index.php(53): include('/customers/2/e/...') :6 {main} thrown in /system/vendor/illuminate/view/FileViewFinder.php on line 146

#2

Note have the problem solved already.