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

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.

Replies are listed 'Best First'.
Re^4: basic CGI::Prototype::Hidden
by zby (Vicar) on Jan 18, 2005 at 19:56 UTC
    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.

        I've read your article about Class::Prototype, but I did not know where it fits. I'll think about it. Thanks again.