Created
September 16, 2022 07:09
-
-
Save Semdevmaster/511f0705ebaaa2690e0746b04c48c4ed to your computer and use it in GitHub Desktop.
ZoomX smarty modifier for get asset from assets manifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Smarty plugin | |
* ------------------------------------------------------------- | |
* Файл: modifier.asset.php | |
* Тип: modifier | |
* Имя: asset | |
* Назначение: Get asset from path. | |
* ------------------------------------------------------------- | |
*/ | |
function smarty_modifier_asset($path) | |
{ | |
global $modx; | |
if ($modx->getOption('development', null, false, true)) { | |
return $modx->getPlaceholder('development_path') . $path; | |
} | |
return "assets/" | |
. $modx->getOption('assets_version', null, 'v1', true) | |
. "/" | |
. $modx->getPlaceholder('manifest')[$path]['file']; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment