view->UserProfile = $profile; // Build tokenized slug for account settings link: "first-last.encryptedId" if ($profile) { $namePart = strtolower(trim(($profile['fname'] ?? '') . '-' . ($profile['lname'] ?? ''), '-')); $namePart = preg_replace('/[^a-z0-9\-]/', '', $namePart); $token = Functions::encryptData((string)$profile['userid'], HASH_PASSWORD_KEY); $this->view->UserSlug = $namePart . '.' . $token; } } } }