Development Guide

Please note: This document is no longer actively maintained. For up-to-date information, please refer to the documentation on GitHub and the collection of development how-tos here.

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)
{
[...]
}