valid_email_address

valid_email_address($mail) Verifies the syntax of the given email address. Parameters string $mail: A string containing an email address. Return value bool TRUE if the address is in a valid format. Deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. Use \Drupal::service('email.validator')->isValid(). Related topics Input validation Functions to validate user input. File core/includes/common.inc, line 180 Common functions that many Drupal modules will need to reference

utility.inc

Miscellaneous functions. File core/includes/utility.inc Functions Name Description drupal_rebuild Rebuilds all caches even when Drupal itself does not work.

UuidInterface

Interface for generating UUIDs. Hierarchy interface \Drupal\Component\Uuid\UuidInterface File core/lib/Drupal/Component/Uuid/UuidInterface.php, line 8 Namespace Drupal\Component\Uuid Members Name Modifiers Type Description UuidInterface::generate public function Generates a Universally Unique IDentifier (UUID).

Utility classes and functions

Overview of utility classes and functions for developers. Drupal provides developers with a variety of utility functions that make it easier and more efficient to perform tasks that are either really common, tedious, or difficult. Utility functions help to reduce code duplication and should be used in place of one-off code whenever possible. See also common.inc File interface Formatting PHP wrapper functions Sanitization functions Transliteration Input validation File core/core.api.php, line 1

user_views_query_substitutions

user_views_query_substitutions(ViewExecutable $view) Implements hook_views_query_substitutions(). Allow replacement of current userid so we can cache these queries. File core/modules/user/user.views_execution.inc, line 15 Provide views runtime hooks for user.module. Code function user_views_query_substitutions(ViewExecutable $view) { return array('***CURRENT_USER***' => \Drupal::currentUser()->id()); }

user_view

user_view($account, $view_mode = 'full', $langcode = NULL) Generate an array for rendering the given user. When viewing a user profile, the $page array contains: $page['content']['member_for']: Contains the default "Member for" profile data for a user. $page['content']['#user']: The user account of the profile being viewed. To theme user profiles, copy core/modules/user/templates/user.html.twig to your theme directory, and edit it as instructed in that file's comments. Parameters \Drupal\use

user_validate_name

user_validate_name($name) Verify the syntax of the given name. Parameters string $name: The user name to validate. Return value string|null A translated violation message if the name is invalid or NULL if the name is valid. File core/modules/user/user.module, line 267 Enables the user registration and login system. Code function user_validate_name($name) { $definition = BaseFieldDefinition::create('string') ->addConstraint('UserName', array()); $data = \Drupal::typedDataManager()

user_view_multiple

user_view_multiple($accounts, $view_mode = 'full', $langcode = NULL) Constructs a drupal_render() style array from an array of loaded users. Parameters \Drupal\user\UserInterface[] $accounts: An array of user accounts as returned by User::loadMultiple(). string $view_mode: (optional) View mode, e.g., 'full', 'teaser', etc. Defaults to 'teaser.' string|null $langcode: (optional) A language code to use for rendering. Defaults to the global content language of the current request. Return value a

user_user_view_alter

user_user_view_alter(array &$build, UserInterface $account, EntityViewDisplayInterface $display) Implements hook_ENTITY_TYPE_view_alter() for user entities. This function adds a default alt tag to the user_picture field to maintain accessibility. File core/modules/user/user.module, line 387 Enables the user registration and login system. Code function user_user_view_alter(array &$build, UserInterface $account, EntityViewDisplayInterface $display) { if (user_picture_enabled() &&a

user_toolbar

user_toolbar() Implements hook_toolbar(). File core/modules/user/user.module, line 1307 Enables the user registration and login system. Code function user_toolbar() { $user = \Drupal::currentUser(); // Add logout & user account links or login link. $links_cache_contexts = []; if ($user->isAuthenticated()) { $links = array( 'account' => array( 'title' => t('View profile'), 'url' => Url::fromRoute('user.page'), 'attributes' => array(