- WIP on picea asset

This commit is contained in:
Dave M. 2023-10-12 12:52:34 -04:00
parent 438b5a69c0
commit 8d22132ef5
3 changed files with 25 additions and 5 deletions

View File

@ -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);
} }
} }
}); });
}, },

View File

@ -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'];
} }

View File

@ -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));