John S J Anderson
2005-06-28 12:59:33 UTC
I'm just starting to try to wrap my head around C::P::Hidden (or vice
versa), so it's entirely possible I'm not thinking about this properly
-- but I can't figure out the Right Way to link to a non-default page.
Suppose I have two "pages": Welcome and Login. (A "page" is a
combination of a .pm and a .tt; there's only one actual CGI.) I have
sub config_default_page { "Welcome" }
in the base My::App.pm.
In Welcome.tt, I want to have an <a> element where the href attribute
takes me to the Login page. It seems like I have two options:
1) use an onClick attribute to manipulate the hidden _state field to
change its value to 'Login'
2) encode '?_state=Login' into the URL in the href attribute (or various
other schnanigans with specifying some state in the URL -- use
'state=login' and switch on that in the respond_per_page() in the
base class, for example)
Is that pretty much accurate or is there some slickness I'm missing?
thanks,
john.
versa), so it's entirely possible I'm not thinking about this properly
-- but I can't figure out the Right Way to link to a non-default page.
Suppose I have two "pages": Welcome and Login. (A "page" is a
combination of a .pm and a .tt; there's only one actual CGI.) I have
sub config_default_page { "Welcome" }
in the base My::App.pm.
In Welcome.tt, I want to have an <a> element where the href attribute
takes me to the Login page. It seems like I have two options:
1) use an onClick attribute to manipulate the hidden _state field to
change its value to 'Login'
2) encode '?_state=Login' into the URL in the href attribute (or various
other schnanigans with specifying some state in the URL -- use
'state=login' and switch on that in the respond_per_page() in the
base class, for example)
Is that pretty much accurate or is there some slickness I'm missing?
thanks,
john.
--
The test of a first-rate intelligence is the ability to hold two
opposed ideas in mind at the same time and still retain the ability to
function. One should, for example, be able to see that things are
hopeless and yet be determined to make them otherwise. - F. Scott Fitzgerald
The test of a first-rate intelligence is the ability to hold two
opposed ideas in mind at the same time and still retain the ability to
function. One should, for example, be able to see that things are
hopeless and yet be determined to make them otherwise. - F. Scott Fitzgerald