Fork me on GitHub

Naming pnRender Output objects  Bottom

  • In the Example module all the pnRender objects look like this:

    Code

    // Create output object
    $pnRender =& new pnRender('Example');


    Does this mean all pnRender objects should be given the same name as your module?

    If so, can someone tell me why we name all our pnRender objects this way? Are there occasions when we would use another name for our pnRender object, such as our function name instead?

    I am trying to understand how the name of pnRender output object affects the rest of the program/functions/hooks/templates of the module and possibly other modules.

    Thanks,

    Charles
  • The parameter to pnRender defines the module name for which pnRender should configure itself. This parameter decides which template directory and plugin directory will be used (i.e. modules/<modname>/pntemplates/ and modules/<modname>/pntemplates/plugins). For the average module then passing no module name to the object constructor will have no effect since the top-level module (pnModGetName) is used instead.

    We chose the define the parameter in all occasions since there may be a requirement for including any of your module functions inside another module (via a pnmodfunc template call).

    This parameter is required for blocks and hook modules so it made sense to include it at all times.

    -Mark

    --
    Visit My homepage and Zikula themes.</modname></modname>
  • 0 users

This list is based on users active over the last 60 minutes.