0

I have configured the "Custom" folders for templates and PHP following https://docs.civicrm.org/dev/en/latest/framework/templates/extending-smarty/

I created this hook file (and I'm sure it's executed)

function joomla_civicrm_config(&$config) {
  $smarty = CRM_Core_Smarty::singleton();
  array_push($smarty->plugins_dir, __DIR__ . '/plugin/');
}

in the "plugin" subfolder (relative to the hook file), I created the function.attachment.php with the code

function smarty_function_attachments(array $params, Smarty_Internal_Template $template) {
  $template->smarty->loadPlugin('...');
}

but this last function is not performed. Where am I wrong?

Thank you

0
1

I see the name of the function is attachments and the file name is attachment. Maybe, you just need to remove an extra "s" from the function name?

function smarty_function_attachment(array $params, Smarty_Internal_Template $template) {
  .
  .
}
1
  • jitendra, thanks for the reply. You're right on the name ma. even by varying it, the function is not called
    – marcello
    Dec 3 '18 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.