/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/AssetMapper/Path/PublicAssetsPathResolver.php
29 строк
788 B
Indra Gunawan
[AssetMapper] add leading slash to public prefix
02 янв 2025, 14:48
02 янв 2025, 14:48
e3a7331
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\AssetMapper\Path; class PublicAssetsPathResolver implements PublicAssetsPathResolverInterface { private readonly string $publicPrefix; public function __construct( string $publicPrefix = '/assets/', ) { // ensure that the public prefix always starts and ends with a single slash $this->publicPrefix = '/'.trim($publicPrefix, '/').'/'; } public function resolvePublicPath(string $logicalPath): string { return $this->publicPrefix.ltrim($logicalPath, '/'); } }