- WIP on picea asset
This commit is contained in:
parent
438b5a69c0
commit
8d22132ef5
|
@ -15,7 +15,7 @@ return [
|
|||
},
|
||||
|
||||
Context::class => function($c) {
|
||||
return new BaseContext( $c->get(Lean\Lean::class)->getPiceaContext() );
|
||||
return new BaseContext($c->get(Lean\Lean::class)->getPiceaContext());
|
||||
},
|
||||
|
||||
Compiler::class => function($c) {
|
||||
|
@ -33,14 +33,15 @@ return [
|
|||
public function registerAll(Compiler $compiler) : void
|
||||
{
|
||||
parent::registerAll($compiler);
|
||||
( new Ui() )->registerFormExtension($compiler);
|
||||
|
||||
if ( class_exists('Picea\\Asset\\Asset') ) {
|
||||
if (class_exists(Ui::class)) {
|
||||
( new Ui() )->registerFormExtension($compiler);
|
||||
}
|
||||
|
||||
if (class_exists(Asset::class)) {
|
||||
( new Asset() )->registerExtension($compiler);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@ class Application
|
|||
|
||||
public array $piceaExtensions;
|
||||
|
||||
public array $piceaAssets;
|
||||
|
||||
public array $views;
|
||||
|
||||
public array $routes;
|
||||
|
@ -47,6 +49,10 @@ class Application
|
|||
$this->piceaExtensions = $picea['extensions'];
|
||||
}
|
||||
|
||||
if ($picea['asset'] ?? false ) {
|
||||
$this->piceaAssets = $picea['asset'];
|
||||
}
|
||||
|
||||
if ($picea['view'] ?? false) {
|
||||
$this->views = $picea['view'];
|
||||
}
|
||||
|
|
13
src/Lean.php
13
src/Lean.php
|
@ -73,6 +73,19 @@ class Lean
|
|||
return $list;
|
||||
}
|
||||
|
||||
public function getPiceaAssets() : array
|
||||
{
|
||||
$list = [];
|
||||
|
||||
foreach(array_reverse($this->applications) as $apps) {
|
||||
if ( $apps->piceaAssets ?? null ) {
|
||||
$list = array_merge_recursive($list, $apps->piceaAssets);
|
||||
}
|
||||
}
|
||||
# dump($list);
|
||||
return $list;
|
||||
}
|
||||
|
||||
public function getRoutable() : array
|
||||
{
|
||||
return array_merge(...array_map(fn($app) => $app->routes ?? [], $this->applications));
|
||||
|
|
Loading…
Reference in New Issue