You are here

private function ModifiersController::stringify in Persistent URL 8

1 call to ModifiersController::stringify()
ModifiersController::modifiers in src/Controller/ModifiersController.php

File

src/Controller/ModifiersController.php, line 39

Class

ModifiersController

Namespace

Drupal\purl\Controller

Code

private function stringify($value) {

  // This can be improved a lot more.
  if (is_scalar($value) || is_array($value)) {
    return json_encode($value);
  }
  else {
    return (string) $value;
  }
}