- WIP on picea-asset
This commit is contained in:
parent
41586b354f
commit
0ededba2f6
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace Picea\Asset;
|
||||
|
||||
enum ActionPrepareEnum
|
||||
{
|
||||
case Copy;
|
||||
case Symlink;
|
||||
}
|
|
@ -3,13 +3,28 @@
|
|||
namespace Picea\Asset;
|
||||
|
||||
use Picea\Compiler;
|
||||
use Picea\Compiler\Context;
|
||||
use Picea\Event\Extension\UrlBuildAssetEvent;
|
||||
use Picea\EventTrait;
|
||||
|
||||
class Asset {
|
||||
|
||||
use EventTrait;
|
||||
|
||||
public function registerExtension(Compiler $compiler) : self
|
||||
{
|
||||
$compiler->registerExtension(new Extension\ImportmapExtension());
|
||||
|
||||
$compiler->getExtensionFromToken('asset')->eventRegister(new class() implements UrlBuildAssetEvent {
|
||||
|
||||
public function execute(string $uri, array $parameters = [], bool $appendVersion) : void
|
||||
{
|
||||
dump($uri);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,11 +14,6 @@ class ImportmapExtension implements Extension {
|
|||
{
|
||||
$cls = static::class;
|
||||
|
||||
switch($token) {
|
||||
case "importmap:print":
|
||||
return "PRINTED";
|
||||
}
|
||||
|
||||
$rendered = json_encode([
|
||||
'output !'
|
||||
]);
|
||||
|
|
Loading…
Reference in New Issue