Closed arnoson closed 2 months ago
This is fixed when changing configure()
to config()
in /mvc-core/src/globals/functions.php
, so I guess BladeUi should also impement configure()
?
Hi @arnoson sorry about this, it seems our documentation did not completely cover the steps to switch to bareui. You will need to swap out your config/view.php
with this config:
<?php
use Leaf\View;
return [
/*
|--------------------------------------------------------------------------
| Template Engine [EXPERIMENTAL]
|--------------------------------------------------------------------------
|
| Leaf MVC unlike other frameworks tries to give you as much control as
| you need. As such, you can decide which view engine to use.
|
*/
'viewEngine' => \Leaf\BareUI::class,
/*
|--------------------------------------------------------------------------
| Custom config method
|--------------------------------------------------------------------------
|
| Configuration for your templating engine.
|
*/
'config' => function ($config) {
View::bareui()->config($config['views']);
},
/*
|--------------------------------------------------------------------------
| Custom render method
|--------------------------------------------------------------------------
|
| This render method is triggered whenever render() is called
| in your app if you're using a custom view engine.
|
*/
'render' => function ($view, $data = []) {
return View::bareui()->render($view, $data);
},
];
This will teach Leaf how to work with BareUI or ant templating engine of your choice.
Great, thanks for the quick reply!
I try to get this running with BareUi instead of Blade templates. What I did was
leafs/blade
and installleafs/bareui
public/index.php
replaceLeaf\View::attach(\Leaf\Blade::class)
withLeaf\View::attach(\Leaf\BareUI::class)
config/view.php
set'viewEngine' => \Leaf\BareUI::class
and replaceView::blade()->configure($config['views'], $config['cache'])
withLeaf\BareUI::config("path", $config['views'])
But I get the following error:
Am I doing something wrong and the mvc requires more config to change the view engine?