You are here

public function BlockService::sanitizeId in Opigno dashboard 3.x

Same name and namespace in other branches
  1. 8 src/BlockService.php \Drupal\opigno_dashboard\BlockService::sanitizeId()

Sanitizes ID string.

Parameters

string $id: The block ID to be sanitized.

Return value

string The sanitized block ID.

Overrides BlockServiceInterface::sanitizeId

2 calls to BlockService::sanitizeId()
BlockService::createBlocksInstances in src/BlockService.php
Creates blocks instances.
BlockService::getAvailableBlocks in src/BlockService.php
Returns available blocks.

File

src/BlockService.php, line 255

Class

BlockService
The dashboard block manager service definition.

Namespace

Drupal\opigno_dashboard

Code

public function sanitizeId(string $id) : string {
  return 'dashboard_' . str_replace([
    ':',
    '-',
  ], [
    '_',
    '_',
  ], $id);
}