Trying to work through your questions in the hope of enlightenment for ... someone:

control_enter's docs are confusing:

I was also confused until I looked at activate():

$this_page->control_enter; ... my $next_page = $this_page->respond; ... if ($this_page ne $next_page) { ... $next_page->control_enter; }

So when you activate the $this_page package, it runs $this_page::control_enter. Then, IFF $this_page::respond returns a different package, we do $next_page::control_enter before $next_page::render*


Just in case render_leave() wants to do some touch-up, no display should be done until all rendering phases are complete.

Isn't this what render is for? I'm treating all the *_enter as "do before * starts" and *_leave as "do after * has finished".


please tell me how I can overwrite the engine method in my subclasses

?? This is something that is in the docs. I C+P'd the example into my top-level package to set the Template defaults.


my $o = __PACKAGE__->reflect; ...

That's not anything to do with CGI::Prototype that I can see:-

chrisb@taf:~ $ perldoc CGI::Prototype | grep -i reflect chrisb@taf:~ $

I'm interested in CGI::Prototype because I'm tired of writing my own call-tables :-) but don't want to have to learn yet another API with dozens of calls.

So far I've got 14 packages inheriting from CGI::Prototype. The main package declares its own app_enter, app_leave, dispatch, engine, error. Of the other packages, 11 declare template(), 11 have overridden respond()s and 5 overridden render_enter()s. There's a dozen or so subs scattered around, used for callbacks from templating.

I've caught myself getting confused a couple of times and had to remind myself that the "usual" flow control (for me) is login::activate, login::respond(do nothing), login::render, login::respond then menu::render, or login::render. From menu::render, menu::respond, opt1::render, opt1::respond, then opt1::render or menu::render.

I've having more trouble getting Class::DBI (which has copious, clear docs) to do what I want :-( This is also being used for the first time on this project, 'cause I'm tired of writing explicit SQL :-)

Hope this helps.


In reply to Re: CGI::Prototype: questions and feedback by cbatjesmond
in thread CGI::Prototype: questions and feedback by metaperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.