2

What functions exist within CiviCRM that make it easy for me to generate internal URLs?

3

In PHP

CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid=$contactID")

See code-level docs for CRM_Utils_System::url for more details.

In Smarty

{crmURL p='civicrm/contact/view' q="reset=1&cid=`$contactID`"}

See code-level docs for CRM_Utils_System::url for more details.

In Javascript

CRM.url('civicrm/contact/view', {"reset": 1, "cid": contactID});

See code-level docs in civicrm/js/crm.ajax.js for CRM.url for more details.

This content was migrated here from the Cheatsheet wiki page as part of the 2017 wiki content migration project.

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.