Objected-oriented programming conventions

Same name and namespace in other branches
  1. 11.x core/core.api.php \oo_conventions
  2. 9 core/core.api.php \oo_conventions
  3. 8.9.x core/core.api.php \oo_conventions
  4. main core/core.api.php \oo_conventions

PSR-4, namespaces, class naming, and other conventions.

A lot of the PHP code in Drupal is object oriented (OO), making use of PHP classes, interfaces, and traits (which are loosely referred to as "classes" in the rest of this topic). The following conventions and standards apply to this version of Drupal:

File

core/core.api.php, line 1483


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.