diff --git a/docs/hooks/hook_civicrm_getAssetUrl.md b/docs/hooks/hook_civicrm_getAssetUrl.md new file mode 100644 index 0000000000000000000000000000000000000000..a308cef3994d44e915de154096ade007787ab9b2 --- /dev/null +++ b/docs/hooks/hook_civicrm_getAssetUrl.md @@ -0,0 +1,32 @@ +# hook_civicrm_getAssetUrl + +## Summary + +This hook is called when building a link to a semi-static asset, allowing you to modify the params the asset will be built with. + +## Notes + +For more discussion, see [AssetBuilder](/framework/asset-builder.md). + +## Definition + + hook_civicrm_getAssetUrl(&$asset, &$params) + +## Parameters + + * `$asset` (string): the logical file name of an asset (ex: `hello-world.json`) + * `$params` (array): an optional set of parameters describing how to build the asset + +## Returns + + * null + +## Example + +```php +function mymodule_civicrm_getAssetUrl(&$asset, &$params) { + if ($asset === 'hello-world.json') { + $params['planet'] = 'Earth'; + } +} +```