blade buiten laravel
Ik probeer blade buiten laravel om te gebruiken.
Heb via composer de view package gedownload en ben al zover dat ik geen error meer kreeg met de make functie.
Het enigste probleem tot nu toe is dat me code op de een of andere manier de views niet kan vinden. ( kan niet verder komen tot nu toe. )
Ik hoop dat iemand me hier mee kan helpen.
Zal mijn composer.json hier plaatsen + de code die ik tot nu toe heb.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"minimum-stability": "dev",
"config": {
"vendor-dir": "system/vendor"
},
"require": {
"nielse63/phpimagecache": "dev-master",
"phpmailer/phpmailer": "dev-master",
"illuminate/database": "4.3.*@dev",
"illuminate/events": "4.3.*@dev",
"illuminate/view": "4.3.*@dev",
"twig/twig": "1.16.*@dev",
"ensepar/html2pdf": "dev-master"
}
}
"minimum-stability": "dev",
"config": {
"vendor-dir": "system/vendor"
},
"require": {
"nielse63/phpimagecache": "dev-master",
"phpmailer/phpmailer": "dev-master",
"illuminate/database": "4.3.*@dev",
"illuminate/events": "4.3.*@dev",
"illuminate/view": "4.3.*@dev",
"twig/twig": "1.16.*@dev",
"ensepar/html2pdf": "dev-master"
}
}
Hier me php code ( Om ruimte te besparen niet de hele class neergezet ) :
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
public function loadBlade($view, $viewPath = false, $data = array() ) {
echo $this->viewPath;
if(isset($viewPath)) {
$this->viewPath = $viewPath;
}
$FileViewFinder = new FileViewFinder(
new Filesystem,
array($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;
}
?>
public function loadBlade($view, $viewPath = false, $data = array() ) {
echo $this->viewPath;
if(isset($viewPath)) {
$this->viewPath = $viewPath;
}
$FileViewFinder = new FileViewFinder(
new Filesystem,
array($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;
}
?>
Hopelijk kan iemand helpen.
Gr wouter.
Er zijn nog geen reacties op dit bericht.