Development Guide

Constants

Constants should be declared in classes. Please avoid using the define statement, even if this is still often used in ILIAS. Use all uppercase for constants. If a constant name consists of more than one word, use a _ to separate the word.

// defining constants
[...]
class ilContainer
{
const SORT_MANUAL = 1;
const SORT_TITLE = 2;
const SORT_ACTIVATION = 3;
[...]
}
// using constants
[...]
if ($sorting == ilContainer::SORT_MANUAL)
{
[...]
}