Init
This commit is contained in:
21
app/Latte/AssetFilter.php
Executable file
21
app/Latte/AssetFilter.php
Executable file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Latte;
|
||||
|
||||
use Nette\Utils\JsonException;
|
||||
use Vite;
|
||||
|
||||
class AssetFilter
|
||||
{
|
||||
public function __construct(
|
||||
private Vite $vite,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function __invoke(string $path): string
|
||||
{
|
||||
return $this->vite->getAsset($path);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user