Core\Is is()
Using our is() function will give you access to our core is class, which is used to check if something is or isn't true based on the method accessed.
<?php
// Check if a user is logged in
if (is()->user()) {
echo "I am a user";
}
// Check if a core module is enabled
if (is()->module('core')) {
echo "core module enabled";
}
// Check if an app is installed
if (is()->app('PHPfox_Videos')) {
echo "video app is installed";
} |
| Method | Description | Usage | Returns | |
|---|---|---|---|---|
module(string $module)
$module Module name | Checks if a module is installed based on the path |
| true on success, false on failure. | |
| user() | Checks if a user is logged in or not. |
| true on success, false on failure.
| |
app(string $app_id)
$app_id App ID | Checks if an app is installed based on the path
|
| true on success, false on failure. |