Helper Class
Table of contents
1. Overview Table of Contents
The Helper class contains globally accessible utility functions to support user interface building, user profile lookups, and object handling. These methods are statically accessible and simplify various common tasks. This class is part of the Core
namespace.
2. buildMenuListItems(array $menu, string $dropdownClass = "")
Table of Contents
Dynamically builds a Bootstrap-friendly navigation menu based on an associative array. Dropdowns, active states, and logout buttons are supported.
Parameters:
array $menu
— The list of menu items (label => path
pairs or nested arrays for dropdowns)string $dropdownClass
— Optional class for styling dropdown menus
Returns:
- A string of HTML list elements (wrapped in
<li>
tags), orfalse
if output buffering fails
3. currentPage()
Table of Contents
Returns the current URL path based on the request URI, normalized for comparison in menu rendering.
Returns:
string
— The current URL path, excluding domain
Note: Automatically treats /
, /home/index
, and app root as equivalent to /home
.
4. getObjectProperties(object $object)
«span style=”float: right; font-size: 14px; padding-top: 15px;”>Table of Contents</span>
Returns a list of accessible (non-static) properties and their values from the given object.
Parameters:
object $object
— The object whose properties will be listed
Returns:
array
— Associative array of properties and values
$userProps = Helper::getObjectProperties($user);
5. getProfileImage()
Table of Contents
Returns the profile image for the currently logged-in user by querying the ProfileImages
model.
Returns:
ProfileImages|null|false
— A profile image object if found;null
orfalse
otherwise