Information types

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

Types of information in Drupal.

Drupal has several distinct types of information, each with its own methods for storage and retrieval:

  • Content: Information meant to be displayed on your site: articles, basic pages, images, files, content blocks, etc. Content is stored and accessed using Entities.
  • Session: Information about individual users' interactions with the site, such as whether they are logged in. This is really "state" information, but it is not stored the same way so it's a separate type here. Session data is accessed via \Symfony\Component\HttpFoundation\Request::getSession(), which returns an instance of \Symfony\Component\HttpFoundation\Session\SessionInterface. See the Sessions topic for more information.
  • State: Information of a temporary nature, generally machine-generated and not human-edited, about the current state of your site. Examples: the time when Cron was last run, whether node access permissions need rebuilding, etc. See the State API topic for more information.
  • Configuration: Information about your site that is generally (or at least can be) human-edited, but is not Content, and is meant to be relatively permanent. Examples: the name of your site, the content types and views you have defined, etc. See the Configuration API topic for more information.

See also

Cache API



core/core.api.php, line 1206

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