public static function LearningPathAccess::replaceGroupUserTokens in Opigno Learning path 3.x
Same name and namespace in other branches
- 8 src/LearningPathAccess.php \Drupal\opigno_learning_path\LearningPathAccess::replaceGroupUserTokens()
Replaces tokens.
1 call to LearningPathAccess::replaceGroupUserTokens()
- LearningPathAccess::notifyUsersByMail in src/
LearningPathAccess.php - Prepares and sends emails to users.
File
- src/
LearningPathAccess.php, line 456
Class
- LearningPathAccess
- Class LearningPathAccess.
Namespace
Drupal\opigno_learning_pathCode
public static function replaceGroupUserTokens(&$text, $params, $token) {
if ($token) {
$text = \Drupal::token()
->replace($text);
}
$text = str_replace([
'[user]',
'[group]',
'[link]',
'[user-role]',
'[user-status]',
], [
$params['account']
->getAccountName(),
$params['group']
->label(),
$params['link'],
$params['roles'],
$params['status'],
], $text);
}