You are here

public function TrumbaBlockBase::isExternalUri in Trumba 8

Same name and namespace in other branches
  1. 2.x src/Plugin/Block/TrumbaBlockBase.php \Drupal\trumba\Plugin\Block\TrumbaBlockBase::isExternalUri()

Check if given Uri is an external url.

Parameters

$uri:

Return value

bool

2 calls to TrumbaBlockBase::isExternalUri()
TrumbaBlockBase::blockValidate in src/Plugin/Block/TrumbaBlockBase.php
TrumbaBlockBase::convertInputToUriString in src/Plugin/Block/TrumbaBlockBase.php
Convert a full url or internal path string to a system Uri.

File

src/Plugin/Block/TrumbaBlockBase.php, line 178

Class

TrumbaBlockBase
Defines a base block implementation that Trumba blocks plugins will extend.

Namespace

Drupal\trumba\Plugin\Block

Code

public function isExternalUri($uri) {
  $parts = parse_url($uri);
  return !empty($parts['host']) ? TRUE : FALSE;
}