in reply to CGI::Prototype: questions and feedback
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*
Isn't this what render is for? I'm treating all the *_enter as "do before * starts" and *_leave as "do after * has finished".
?? This is something that is in the docs. I C+P'd the example into my top-level package to set the Template defaults.
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.
|
|---|