summaryrefslogtreecommitdiff
path: root/app/Helper/User.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Helper/User.php')
-rw-r--r--app/Helper/User.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/Helper/User.php b/app/Helper/User.php
index 1cad6042..c1fff8c6 100644
--- a/app/Helper/User.php
+++ b/app/Helper/User.php
@@ -11,6 +11,24 @@ namespace Helper;
class User extends \Core\Base
{
/**
+ * Get initials from a user
+ *
+ * @access public
+ * @param string $name
+ * @return string
+ */
+ public function getInitials($name)
+ {
+ $initials = '';
+
+ foreach (explode(' ', $name) as $string) {
+ $initials .= mb_substr($string, 0, 1);
+ }
+
+ return mb_strtoupper($initials);
+ }
+
+ /**
* Get user id
*
* @access public