in reply to Re: basic CGI::Prototype::Hidden
in thread basic CGI::Prototype::Hidden

Thank you. One more question - what should go into My::App?

Replies are listed 'Best First'.
Re^3: basic CGI::Prototype::Hidden
by merlyn (Sage) on Jan 18, 2005 at 18:14 UTC
    Well, "welcome" is one page, so you put methods that are page-specific there. "My::App" is the application, so you put methods and data that are application-wide there, including the setting of those config variables.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      I still don't get how the code in My::App is called. I mean the activate method dispaches to My::App::welcome - how the control goes back? How can I use My::App methods in My::App::welcome? One answer I see is that My::App::welcome should be derived from My::App instead of CGI::Prototype. Would it not be simpler if the activate function was a Class method so that the My::App object would be completly optional?
        Well, in the world of Class::Prototyped, classes and instances are one, so your comment is a bit confusing to me.

        My::App::welcome ISA My::App ISA CGI::Prototype::Hidden ISA CGI::Prototype ISA Class::Prototyped.

        Activate gets called against My::App.

        Does that help?

        -- Randal L. Schwartz, Perl hacker
        Be sure to read my standard disclaimer if this is a reply.