You are here

class SocialUserSearchContentBlockAlter in Open Social 10.1.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_user/src/SocialUserSearchContentBlockAlter.php \Drupal\social_user\SocialUserSearchContentBlockAlter
  2. 10.0.x modules/social_features/social_user/src/SocialUserSearchContentBlockAlter.php \Drupal\social_user\SocialUserSearchContentBlockAlter
  3. 10.2.x modules/social_features/social_user/src/SocialUserSearchContentBlockAlter.php \Drupal\social_user\SocialUserSearchContentBlockAlter

Provides a trusted callback to alter the system branding block.

Hierarchy

Expanded class hierarchy of SocialUserSearchContentBlockAlter

See also

social_user_block_view_search_content_block_alter()

1 file declares its use of SocialUserSearchContentBlockAlter
social_user.module in modules/social_features/social_user/social_user.module
The social user module alterations.

File

modules/social_features/social_user/src/SocialUserSearchContentBlockAlter.php, line 12

Namespace

Drupal\social_user
View source
class SocialUserSearchContentBlockAlter implements TrustedCallbackInterface {

  /**
   * Pre render for the search content in the header. This will add javascript.
   */
  public static function preRender($build) {

    // Attach the social_search library defined in social_search.libraries.yml.
    $build['#attached'] = [
      'library' => [
        'social_search/navbar-search',
      ],
    ];
    return $build;
  }

  /**
   * {@inheritdoc}
   */
  public static function trustedCallbacks() {
    return [
      'preRender',
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SocialUserSearchContentBlockAlter::preRender public static function Pre render for the search content in the header. This will add javascript.
SocialUserSearchContentBlockAlter::trustedCallbacks public static function Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface::trustedCallbacks
TrustedCallbackInterface::THROW_EXCEPTION constant Untrusted callbacks throw exceptions.
TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION constant Untrusted callbacks trigger silenced E_USER_DEPRECATION errors.
TrustedCallbackInterface::TRIGGER_WARNING constant Untrusted callbacks trigger E_USER_WARNING errors.