26 lines
711 B
PHP
26 lines
711 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Evoweb\EwBase\User;
|
|
|
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|
use TYPO3\CMS\Core\Utility\PathUtility;
|
|
|
|
/**
|
|
* EXAMPLE:
|
|
* page.headerData.10 = USER
|
|
* page.headerData.10.userFunc = Evoweb\EwBase\User\AssetPath->getAbsolutePublicPath
|
|
* page.headerData.10.file = EXT:site_package/Resources/Public/manifest.json
|
|
* page.headerData.10.stdWrap.wrap = <link rel="manifest" href="|"/>
|
|
*/
|
|
class AssetPath
|
|
{
|
|
public function getAbsolutePublicPath(string $content, array $conf): string
|
|
{
|
|
return $content
|
|
. GeneralUtility::getIndpEnv('TYPO3_SITE_URL')
|
|
. ltrim(PathUtility::getPublicResourceWebPath($conf['file']), '/');
|
|
}
|
|
}
|