You are here

function _surl in ShURLy 8

Same name and namespace in other branches
  1. 6 shurly.module \_surl()
  2. 7 shurly.module \_surl()

Internal function to format a URL without language prefixing or subdomain rewrites

4 calls to _surl()
ShurlyCreateForm::validateForm in src/Form/ShurlyCreateForm.php
Form validation handler.
ShurlyShortUrl::render in src/Plugin/views/field/ShurlyShortUrl.php
Renders the field.
shurly_expand in ./shurly.module
Function to get the long url.
shurly_shorten in ./shurly.module
API function to shorten a URL.

File

./shurly.module, line 618
Description http://www.youtube.com/watch?v=Qo7qoonzTCE.

Code

function _surl($path = NULL, $options = []) {
  $shurly_base = _shurly_get_shurly_base();

  // Set default language object which will avoid redirects and subdomains.
  $options['language'] = Language::$defaultValues;
  return Url::fromUri($shurly_base . '/' . $path, $options)
    ->toString();
}