Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
pnModFunc and non standard arg
  • Posted: 05.01.2006, 07:24
     
    Topiatic
    rank:
    Professional Professional
    registered:
     November 2003
    Status:
    online
    Posts:
    1676
    I noticed a modules useing a files called pnsomething.php that have functions called ModName_something_func($args), and are called with pnModFunc(ModName, something, func, array($args)). Well I thought this was brilliant for my now growing pncommon.php file.

    Question is, is this acceptable and wil it continue to work for future versions of PostNuke? The answer tells me weather or not to just create a universal pncommon directory.

    TIA

    --
    Under Construction!
  • Posted: 05.01.2006, 13:13
     
    Simon
    rank:
    Steering Committee Steering Committee
    registered:
     December 2002
    Status:
    offline
    last visit:
    23.11.08
    Posts:
    13415
    The actual syntax is modname_type_func($args)

    The type can be anything, but it is usually 'user' or 'userapi' - and each category of function is stored in pntype.php. If you need more functions than sensibly fit in a single file, then you can use more than one API file, for example, a common API.

    pnModAPILoad('mymod', 'common');

    pnModAPIFunc('mymod', 'common', 'func', array());

    Further, you can split these functions into subdirectories into your module if you have enough files to warrant doing this.

    --
    Regards,
    Simon

    itbegins.co.uk - Zikula Consulting

    Please read the Support Guide

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula