Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
optometrists
/
cache
/
cache
/
cache
/
cache
/
cache
/
cache
/
cache
/
.wp-cli
/
wp-content
/
plugins
/
wp-phpmyadmin-extension
/
lib
/
phpMyAdmin
/
libraries
/
classes
/
Twig
:
AssetExtension.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php declare(strict_types=1); namespace PhpMyAdmin\Twig; use PhpMyAdmin\Theme; use Twig\Extension\AbstractExtension; use Twig\TwigFunction; final class AssetExtension extends AbstractExtension { /** * @return TwigFunction[] */ public function getFunctions() { return [ new TwigFunction('image', [$this, 'getImagePath']), ]; } public function getImagePath(?string $filename = null, ?string $fallback = null): string { global $theme; if (! $theme instanceof Theme) { return ''; } return $theme->getImgPath($filename, $fallback); } }