XMF Cookbook
  • Introduction
  • XMF Cookbook
  • Basic Ingredients
    • Namespaces
    • Autoloading
    • Debugging
    • Forward Compatibility
  • Recipes
    • Introducing Module Helpers
    • Using the Permission Helper
      • Checking Permissions
      • Managing Item Permissions
    • Using the Session Helper
    • Using JSON Web Tokens
    • Altering Database Tables
    • Migrating a Module's Database
    • Loading Initial Data
    • Module Admin Pages
      • Hide and Seek with Icons
      • Standard Admin Pages
    • Manage Metadata
    • Highlighting Content
  • Reference
    • Assert
      • Assertions
    • Database
      • Migrate
      • TableLoad
      • Tables
        • Getting Started
        • Table Operations
        • Working with Columns
        • Working with Indexes
        • Changing Table Data
        • Interacting with the Work Queue
        • Error Info and Debugging
    • Debug
    • FilterInput
    • Highlighter
    • IPAddress
    • Jwt
      • JsonWebToken
      • KeyFactory
      • TokenFactory
      • TokenReader
    • Key
      • ArrayStorage
      • Basic
      • FileStorage
      • KeyAbstract
      • StorageInterface
    • Language
    • Metagen
      • Extracting Data
      • Applying Data
    • Module
      • Admin
      • Helper
      • Helper
        • AbstractHelper
        • Cache
        • GenericHelper
        • Permission
        • Session
    • ProxyCheck
    • Random
    • Request
    • StopWords
    • Uuid
    • Yaml
  • Credits
  • License:
  • Table of Content
Powered by GitBook
On this page
  • getHelper($dirname)
  • getModule()
  • getConfig($name, $default)
  • getHandler($name)
  • loadLanguage($name)
  • setDebug($bool)
  • addLog($log)
  • isCurrentModule()
  • isUserAdmin()
  • url($url)
  • path( string $path = '' )
  • redirect($url, $time, $message)
  • uploadUrl($url)
  • uploadPath( string $path = '' )
  1. Reference
  2. Module

Helper

PreviousAdminNextHelper

Last updated 5 years ago

The Xmf\Module\Helper class is used to obtain a module helper. A module helper can simplify routine module related operations.

For XOOPS 2.5 systems, the module helper returned will be an instance of the .

getHelper($dirname)

Get an instance to a module helper for a module directory in $dirname.

Returns a Helper instance or false on error.

getModule()

Returns a XoopsModule object for the module represented by this Helper.

getConfig($name, $default)

Returns the value of the module config item $name, or an array of all config items if $name is empty or not specified. If config item $name does not exist $default, null if not specified, is returned.

getHandler($name)

Returns an Object Handler for the module's $name handler, or false if the handler does not exist.

loadLanguage($name)

Load language support for $name for this module

setDebug($bool)

Set debug option for the helper on (true) or off (false.) The default for $bool, if not specified, is true.

addLog($log)

Add the message string $log to the module log.

isCurrentModule()

Returns true if this module is the currently active module, otherwise false.

isUserAdmin()

Returns true if the current user has admin rights to this module, otherwise false.

url($url)

Returns an absolute URL for a module relative URL specified in $url.

path( string $path = '' )

Returns an absolute filesystem path for a module relative path specified in $path.

redirect($url, $time, $message)

Redirects the session within the same module, to the module relative URL specified in $url.

uploadUrl($url)

Return absolute URL for a module relative upload file specified in $url.

uploadPath( string $path = '' )

Return absolute filesystem path for a module relative upload file specified in $path.

Xmf\Module\Helper\GenericHelper