You are here

public static function AutoUsernameSettingsForm::autoUsernameEval in Automatic User Names 8

Evaluate php code and pass $account to it.

1 call to AutoUsernameSettingsForm::autoUsernameEval()
AutoUsernameSettingsForm::autoUsernamePatternprocessor in src/Form/AutoUsernameSettingsForm.php
Process an account and return its new username according to currentpattern.

File

src/Form/AutoUsernameSettingsForm.php, line 419

Class

AutoUsernameSettingsForm
Class AutoUsernameSettingsForm.

Namespace

Drupal\auto_username\Form

Code

public static function autoUsernameEval($code, $account) {
  ob_start();
  print eval('?>' . $code);
  $output = ob_get_contents();
  ob_end_clean();
  return $output;
}