Fork me on GitHub

Create $pnrender object or not.  Bottom

  • So, you'r writing a module. In this module you have the usual security checks like :

    Code

    if (!pnSecAuthAction(0, 'Example::', '::', ACCESS_OVERVIEW)) {
            return pnVarPrepHTMLDisplay(_MODULENOAUTH);
        }


    I was thinking you could do this with a template to. Where the template just says <--[pnml name="_MODULENOAUTH"]-->

    Code

    $pnRender =& new pnRender('Example');
       
            if (!pnSecAuthAction(0, 'Example::', '::', ACCESS_OVERVIEW)) {
                 return $pnRender->fetch('example_noauth.htm');
           }



    I'm just wondering why should/shouldn't one do this.
    Things i could come up with :
    + Gives the user more freedom to change the appearance of their site.
    - If every module makes different looking pages for these securitychecks or errors it will make your site look inconsistent by default.

    Something i'm not sure of :
    Creating the $pnrender will probably mean extra overhead, but it also gives the possibility to cache it (not that visitors should ever see this pages but....)

    What's your opinion about this ?
  • The reason for simply returning the text is that we're only outputing a simple text string so instantiating a pnRender object seems like overkill. The plan is that all errors will be passed on to a dedicated module handling all system errors. This module will then use pnRender to allow for more complex (and nicer) error pages.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Ah, forgot about the errors module in the pn0.8 cvs.

    BTW : is there something going on with the viewcvs ? No matter what i select it always says :
    NOTE: There are x files, but none match the current selection criteria
  • The errors module isn't very advanced yet though...

    Viewcvs has been broken since our recent server upgrade. It's a known issue but i don't have a timescale on the fix as yet.

    -Mark

    --
    Visit My homepage and Zikula themes.

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