Skip to content
This repository was archived by the owner on Oct 4, 2024. It is now read-only.

Commit 875505b

Browse files
committed
✨ added experimental view features
1 parent bb20ef0 commit 875505b

3 files changed

Lines changed: 11 additions & 36 deletions

File tree

Config/aloe.php

Lines changed: 0 additions & 18 deletions
This file was deleted.

Config/functions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ function plural($value, $count = 2)
159159
if (!function_exists('render')) {
160160
function render(string $view, array $data = [])
161161
{
162-
if (viewConfig("view_engine") === \Leaf\Blade::class) {
163-
return markup(view($view, $data));
164-
}
162+
if (!viewConfig("experimental")) {
163+
return markup(view($view, $data));
164+
}
165165

166166
return viewConfig("render")($view, $data);
167167
}

Config/view.php

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,33 +27,26 @@
2727

2828
/*
2929
|--------------------------------------------------------------------------
30-
| Template Engine [EXPERIMENTAL]
30+
| Leaf EXPERIMENTAL features
3131
|--------------------------------------------------------------------------
3232
|
33-
| Leaf MVC unlike other frameworks tries to give you as much control as
34-
| you need. As such, you can decide which view engine to use.
33+
| This allows you to use the experimental features below
3534
|
3635
*/
37-
"view_engine" => \Leaf\Blade::class,
36+
"experimental" => false,
3837

3938
/*
4039
|--------------------------------------------------------------------------
4140
| Custom render method [EXPERIMENTAL]
4241
|--------------------------------------------------------------------------
4342
|
44-
| This render method is triggered whenever render() is called
45-
| in your app if you're using a custom view engine.
43+
| This render method is triggered whenever render() with the experimental
44+
| option above set to true. This render method allows you to even plug
45+
| in external view libraries, configure them and call them with `render`
46+
| whenever and wherever you feel the need.
4647
|
4748
*/
4849
"render" => function(string $view, array $data = []) {
49-
$veins = new \Leaf\Veins\Template;
50-
$veins->configure([
51-
"veins_dir" => views_path(null, false),
52-
"cache_dir" => storage_path('framework/views/'),
53-
]);
54-
$veins->set($data);
55-
$veins->render($view);
56-
57-
// This example is what veins would look like
50+
return markup(view($view, $data));
5851
},
5952
];

0 commit comments

Comments
 (0)