# AbstractHelper

The `Xmf\Module\Helper\AbstractHelper` abstract class is the base class for module aware helpers.

## \_\_construct(*$dirname*)

Instantiate a XoopsModule object for the helper to use. If the string *$dirname* is empty, the current module in XOOPS will be user. Otherwise, it will attempt to load the module by name.

## init()

init() is called by the constructor after the appropriate XoopsModule object is loaded.

## dirname()

Returns the module dirname associated with the helper.

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


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
