Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Using our is() function will give you access to our core is Is class, which is used to check if something is or isn't true based on the method accessed.

...

MethodDescriptionUsageReturns

module(string $module)

 


$module

Module name

Checks if a module is installed based on the path
PF.Base/module/ 

Code Block
languagephp
// Check if a core module is enabled
if (is()->module('core')) {
   echo "core module enabled";
}

true on success, false on failure.

user()

Checks if a user is logged in or not.

Code Block
languagephp
if (is()->user()) {
   echo "I am a user";
}

true on success, false on failure.

 

app(string $app_id)

 


$app_id

App ID

Checks if an app is installed based on the path
PF.Site/Apps/ 

 

Code Block
languagephp
// Check if an app is installed
if (is()->app('PHPfox_Videos')) {
   echo "video app is installed";
}
true on success, false on failure.