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