CNCat 4.3.1 User Manual
Variables Display
Format 1: {$variable_name}
Format 2: {$array_name[index1] }
Format 3: {$array_name[index1][index2]}
Example 1: {$CNCAT[item][link_url]}
Example 2: {cn_str($CNCAT[item][item_title])}
It is used for displaying variables and arrays elements. For instance, Example 1 shows display of a link URL.
Example 2 uses additional function cn_str(), equal to PHP-function htmlspecialchars(). This function prevents from insertion of harmful JS and HTML-code. It is recommended to use this function for displaying of all string variables.
Note: Arrays indexes are defined without inverted commas.
For the sake of safety the following variables are available in templates at present:
- $CNCAT – array, containing all information about a page and displayed data;
- $THEMEURL – root URL for theme files;
- $CNCAT_ENGINE – CNCat engine object.