Developers: Adding Simple CDN support in your modules
Last updated on
30 April 2025
Integration is very easy, you only need two bits of code. One an invoke function to the API so Simple CDN can register your element as something which can be used.
/**
* Implementation of hook_simplecdnapi().
*/
function yourmodulename_simplecdnapi($op) {
switch ($op) {
case 'load':
return array(
'eid' => 'yourmodulename',
'name' => 'Your Module Name',
);
break;
}
}
Next you will need to place this code where you need a URL to be processed by Simple CDN.
if (module_exists('simplecdn')) {
$url = simplecdn_rewrite_url($url, 'yourmodulename');
}
Help improve this page
Page status: Not set
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion