xoops forums

AndyM

Quite a regular
Posted on: 2010/10/10 18:22
AndyM
AndyM (Show more)
Quite a regular
Posts: 296
Since: 2003/8/31
#1

xoops_getmodulehandler()

I've tried using the xoops_getmodulehandler() function for the first time, but have had little success.

As I understand it, you use the name of the class file in the module's class directory (without the .php extension). With the module's name (directory name) as an option.

I can duplicate a file and give it different names, but it might only work if I use "menu" for example, if it's called something else, it fails.

I'm not sure if I'm missing something here or not?

For example:

ErrorHandler does not exist
Module
amevents
Name
adminmenu


I've not done much coding over the last couple of years, so I'm rusty and looking at the function itself is not revealing anything to me.

bumciach

Not too shy to talk
Posted on: 2010/10/11 8:15
bumciach
bumciach (Show more)
Not too shy to talk
Posts: 153
Since: 2007/6/25
#2

Re: xoops_getmodulehandler()

Do you change the name of the class also inside this file?

AndyM

Quite a regular
Posted on: 2010/10/11 13:03
AndyM
AndyM (Show more)
Quite a regular
Posts: 296
Since: 2003/8/31
#3

Re: xoops_getmodulehandler()

Ah, thanks, that pointed me in the right direction.

For future reference for other people, the class name has to be:

class <Modulename><Filename>Handler code }


Where <Modulename> is the name of the module (automatically filled if not specified, and <Filename> is the name specified.

iHackCode

Module Developer
Posted on: 2010/10/11 14:56
iHackCode
iHackCode (Show more)
Module Developer
Posts: 1036
Since: 2004/6/29
#4

Re: xoops_getmodulehandler()

https://xoops.org/modules/mediawiki/index.php/Dev:using_xoops_api <-- needs a little organizing
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧

redheadedrod

Home away from home
Posted on: 2010/10/11 16:21
redheadedrod
redheadedrod (Show more)
Home away from home
Posts: 1296
Since: 2008/2/26
#5

Re: xoops_getmodulehandler()

Quote:

Bandit-X wrote:
https://xoops.org/modules/mediawiki/index.php/Dev:using_xoops_api <-- needs a little organizing


Yes the whole wiki could use some organizing. Something is in progress but is going slow. Will write up something more when it is available.