State API

Information about the State API. The State API is one of several methods in Drupal for storing information. See the Information types topic for an overview of the different types of information. The basic entry point into the State API is \Drupal::state(), which returns an object of class \Drupal\Core\State\StateInterface. This class has methods for storing and retrieving state information; each piece of state information is associated with a string-valued key. Example: // Get the state class.

State

Provides the state system using a key value store. Hierarchy class \Drupal\Core\State\State implements StateInterface File core/lib/Drupal/Core/State/State.php, line 10 Namespace Drupal\Core\State Members Name Modifiers Type Description State::$cache protected property Static state cache. State::$keyValueStore protected property The key value store to use. State::delete public function Deletes an item. Overrides StateInterface::delete State::deleteMulti

State::delete

public State::delete($key) Deletes an item. Parameters string $key: The item name to delete. Overrides StateInterface::delete File core/lib/Drupal/Core/State/State.php, line 100 Class State Provides the state system using a key value store. Namespace Drupal\Core\State Code public function delete($key) { $this->deleteMultiple(array($key)); }

State::$keyValueStore

The key value store to use. Type: \Drupal\Core\KeyValueStore\KeyValueStoreInterface File core/lib/Drupal/Core/State/State.php, line 17 Class State Provides the state system using a key value store. Namespace Drupal\Core\State Code protected $keyValueStore;

State::$cache

Static state cache. Type: array File core/lib/Drupal/Core/State/State.php, line 24 Class State Provides the state system using a key value store. Namespace Drupal\Core\State Code protected $cache = array();

Standard::needsRemoval

protected static Standard::needsRemoval($html_tags, $elem) Whether this element needs to be removed altogether. Parameters $html_tags: The list of HTML tags. $elem: The name of the HTML element. Return value bool TRUE if this element needs to be removed. Overrides Xss::needsRemoval File core/modules/editor/src/EditorXssFilter/Standard.php, line 167 Class Standard Defines the standard text editor XSS filter. Namespace Drupal\editor\EditorXssFilter Code protected static function needsR

standard_install

standard_install() Implements hook_install(). Perform actions to set up the site for this profile. See also system_install() File core/profiles/standard/standard.install, line 19 Install, update and uninstall functions for the standard installation profile. Code function standard_install() { // Set front page to "node". \Drupal::configFactory()->getEditable('system.site')->set('page.front', '/node')->save(TRUE); // Allow visitor account creation with administrative approval.

Standard::getForbiddenTags

protected static Standard::getForbiddenTags($restrictions) Get all forbidden tags from a restrictions data structure. Parameters array|false $restrictions: Restrictions as returned by FilterInterface::getHTMLRestrictions(). Return value array An array of forbidden HTML tags. See also \Drupal\filter\Plugin\Filter\FilterInterface::getHTMLRestrictions() File core/modules/editor/src/EditorXssFilter/Standard.php, line 155 Class Standard Defines the standard text editor XSS filter. Namespac

Standard::getAllowedTags

protected static Standard::getAllowedTags($restrictions) Get all allowed tags from a restrictions data structure. Parameters array|false $restrictions: Restrictions as returned by FilterInterface::getHTMLRestrictions(). Return value array An array of allowed HTML tags. See also \Drupal\filter\Plugin\Filter\FilterInterface::getHTMLRestrictions() File core/modules/editor/src/EditorXssFilter/Standard.php, line 131 Class Standard Defines the standard text editor XSS filter. Namespace Dru

Standard

Defines the standard text editor XSS filter. Hierarchy class \Drupal\Component\Utility\Xssclass \Drupal\editor\EditorXssFilter\Standard implements EditorXssFilterInterface File core/modules/editor/src/EditorXssFilter/Standard.php, line 13 Namespace Drupal\editor\EditorXssFilter Members Name Modifiers Type Description Standard::filterXss public static function Filters HTML to prevent XSS attacks when a user edits it in a text editor. Overrides EditorXssFilterInterface::f