> For the complete documentation index, see [llms.txt](https://xoops.gitbook.io/xmf-cookbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xoops.gitbook.io/xmf-cookbook/reference/module/helper.md).

# Helper

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 [Xmf\Module\Helper\GenericHelper](/xmf-cookbook/reference/module/helper-1/generichelper.md).

## 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*.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://xoops.gitbook.io/xmf-cookbook/reference/module/helper.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
