This documentation relates to CiviCRM version 3.2. It's not maintained anymore.
Current version of documentation.


Aller directement à la fin des métadonnées
Aller au début des métadonnées

This page refers to outdated version of CiviCRM. Check current version of documentation.

Documentation Search

CiviCRM 3.2 Documentation

Support and Participation

Developer Resources

CiviCRM book!

Make sure to check out Understanding CiviCRM as well! You can also support this project by ordering a hard copy.

Quick & dirty list of handy functions, variables etc - only just started this

Generating CiviURLS

1) To create a CiviCRM URL

 CRM_Utils_System::url($path = null, $query = null, $absolute = false, $fragment = null, $htmlize = true, $frontend = false )

e.g. to generate the URL the user should be directed to after making a payment (e.g. at a bank's site). Note the $frontend variable determines whether Joomla users will return to a front-end (end user) page or not

2) To generate a full path URL in the civicrm code base:
3) To generate a full path URL in the sites custom_php directory
4) To generate a CiviCRM URL from a smarty template

You can construct this URL within a .tpl file using the custom CiviCRM Smarty function crmURL as below where p='the bit before the question mark' (path) and q='the bit after the question mark' (query) and h='the link text'

Debugging & troubleshooting

Redirecting email output
Output all email to disk files OR discard

define('CIVICRM_MAIL_LOG', 1);
This setting causes all outbound CiviCRM email to be written to files on your server's disk drive (Send Email to Contacts, Contribution and Event receipts, CiviMail mail ...). No real emails are sent. Emails are written to files in templates_c/en_US/ConfigAndLog/mail directory by default.

define('CIVICRM_MAIL_LOG', '/dev/null');
This setting causes all outbound emails to be discarded. No email is sent and emails are NOT written to disk.

Increasing what gets output to your CiviCRM log

You can edit your civicrm.settings.php to output more information about queries that run. Obviously there is a performance hit for these so use wisely

Output all sql queries run by CiviCRM to a CiviCRM.*.log file in the files/civicrm/templates_c/en_US/ConfigAndLog/ directory

Include a backtrace of the php functions that led to this query

Output queries to browser screen

define('CIVICRM_DAO_DEBUG', 1);
Writes out various data layer queries to your browser screen.

In many cases enabling MySQL query logging can be more effective.

CiviCRM debug functions

View a variable

crm_core_error::debug( $params ); exit();

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.