From 6c3029fd8e168614ab24e6c4d3a57c40996c6b5b Mon Sep 17 00:00:00 2001 From: colemanw <coleman@civicrm.org> Date: Sat, 8 Jun 2019 10:33:59 -0400 Subject: [PATCH] Fix #616 document hook_civicrm_getAssetUrl --- docs/hooks/hook_civicrm_getAssetUrl.md | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 docs/hooks/hook_civicrm_getAssetUrl.md diff --git a/docs/hooks/hook_civicrm_getAssetUrl.md b/docs/hooks/hook_civicrm_getAssetUrl.md new file mode 100644 index 00000000..a308cef3 --- /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'; + } +} +``` -- GitLab