Answers.Body: <h3>In PHP</h3>
  
  <pre><code>CRM_Utils_System::url('civicrm/contact/view', "reset=1&amp;cid=$contactID")
  </code></pre>
  
  <p>See code-level docs for <code>CRM_Utils_System::url</code> for more details.</p>
  
  <h3>In Smarty</h3>
  
  <pre><code>{crmURL p='civicrm/contact/view' q="reset=1&amp;cid=`$contactID`"}
  </code></pre>
  
  <p>See code-level docs for <code>CRM_Utils_System::url</code> for more details.</p>
  
  <h3>In Javascript</h3>
  
  <pre><code>CRM.url('civicrm/contact/view', {"reset": 1, "cid": contactID});
  </code></pre>
  
  <p>See code-level docs in <code>civicrm/js/crm.ajax.js</code> for <code>CRM.url</code> for more details.</p>
  
  <p><em>This content was migrated here from the <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Cheatsheet" rel="nofollow noreferrer">Cheatsheet</a> wiki page as part of the 2017 wiki content migration project.</em></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-09T22:36:33.203Z
Answers.LastActivityDate: 2017-08-09T22:36:33.203Z
Answers.UserDisplayName: Sean
Body: <p>What functions exist within CiviCRM that make it easy for me to generate internal URLs?</p>
  
Tags: <developer>
Title: How can I generate an internal URL to a CiviCRM page based on certain parameters?
ThreadText: # How can I generate an internal URL to a CiviCRM page based on certain parameters?
  
  (Asked by: username_0 on 2017-08-09)
  
  What functions exist within CiviCRM that make it easy for me to generate internal URLs?
  
  **Tags:** developer
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-08-09. Score: 4
  
  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.
  
  
  ---
  
  