Removed encore added books crud
This commit is contained in:
22
src/Twig/AppExtension.php
Normal file
22
src/Twig/AppExtension.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
class AppExtension extends AbstractExtension
|
||||
{
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new TwigFunction('file_exists', [$this, 'file_exists']),
|
||||
];
|
||||
}
|
||||
|
||||
public function file_exists(string $file): bool
|
||||
{
|
||||
return file_exists(ltrim($file, '/'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user