Hi all,
Suppose I want to have the first path match a pattern, like an
ISO-8601 date. I then want to chop it out of the URI path and stash it
and forward the request on to another handler in the fashion of
mod_perl's $r-internal_redirect. Consider:
package MyApp;
sub _date
You want chained actions.
package MyApp;
sub _date :Chained('/') CaptureArgs(1) PathPart('date') {
my $self = shift;
my $c = shift;
my $date = shift;
$c-detach('invalid_date') unless($date =~ /^\d{4}-\d{2}-\d{2}/);
$c-stash-{date} = $date;
}
sub something_using_the_date :Chained('/date')
On 13 November 2010 02:54, Bill Moseley mose...@hank.org wrote:
Any tricks to do a $c-visit type of call but w/o doing a full dispatch,
that is, without calling the auto and end actions?
Doesn't $c-forward(...) do exactly that? Or have I completely
misunderstood the docs?
$c-visit( $action [,
Hi Woosely Xu -
On Mon, 15 Nov 2010 10:32 +0800, woosley. xu. redic...@gmail.com
wrote:
I am still wondering why forward dose not working in my way, and I
just find detach('login') works good.
Because forward() returns to the action from which it was called, and
detach() does not:
Charlie == Charlie Garrison garri...@zeta.org.au writes:
Charlie I've never bothered to find out why, but I've run into
Charlie situations where $c-user_exists returns true and $c-user
Charlie returns false. I just check for defined($c-user) instead
Charlie and that solved it for
* Bill Crawford billcrawford1...@gmail.com [2010-11-15 14:20]:
On 13 November 2010 02:54, Bill Moseley mose...@hank.org wrote:
Any tricks to do a $c-visit type of call but w/o doing
a full dispatch, that is, without calling the auto and end
actions?
Doesn't $c-forward(...) do exactly
Dorian == Dorian Taylor (Lists) dorian.taylor.li...@gmail.com writes:
Dorian I'm ambiguous on two things:
Dorian 1) I don't understand why an outside request to /foo will find its
way to
Dorian /foo/index in MyApp::Foo but a forwarded request will not. I
understand I'm
Dorian
Hi Ben, thanks for replying!
On 15-Nov-10, at 4:00 AM, Ben van Staveren wrote:
You want chained actions.
package MyApp;
sub _date :Chained('/') CaptureArgs(1) PathPart('date') {
my $self = shift;
my $c = shift;
my $date = shift;
$c-detach('invalid_date') unless($date =~
On Mon, Nov 15, 2010 at 9:26 AM, Bill Crawford
billcrawford1...@gmail.comwrote:
No, `forward` does not do a full redispatch. Most importantly,
if you’re using chains in your app, then `visit` will walk the
entire chain to the action you passed and call those actions
(as well as all the
Thanks Eden,
On 15-Nov-10, at 8:58 AM, Eden Cardim wrote:
Internal action paths are one thing and URI's are another. Forwarding
and dispatching are two separate things. The dispatch process
matches a
URI and happens once per request (unless you invoke -go or
-visit). Forwarding is mostly a
Hi Dorian -
OK, but the part that confuses me is why /foo doesn't resolve to
MyApp::Foo::index with -go or -visit.
Maybe this will help (I think in this case index works like
default):
http://wiki.catalystframework.org/wiki/wikicookbook/safedispatchusingpath
HTH,
Larry
Hi Larry,
On 15-Nov-10, at 10:55 AM, Larry Leszczynski wrote:
Hi Dorian -
OK, but the part that confuses me is why /foo doesn't resolve to
MyApp::Foo::index with -go or -visit.
Maybe this will help (I think in this case index works like
default):
http://www.confraternitediocesicatania.it/here.php
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site:
On Mon, Nov 15, 2010 at 11:10 AM, Dorian Taylor (Lists)
dorian.taylor.li...@gmail.com wrote:
package MyApp;
sub _date :Regex('^(\d{4}-\d{2}-\d{2})(.*)$') {
my ($self, $c) = @_;
my ($date, $rest) = @{$c-req-captures};
$c-req-path($rest);
$c-dispatcher-prepare_action($c);
Hello all,
I'm hoping someone can help me with C:C:IPC. I need my application to
authenticate
against one database, then use $c-user-dsn after authentication to
connect to that
customer's application database. I've been digging through docs and the
code in
C:C:IPC as well as ACCEPT_CONTEXT
Good morning,
On 15/11/10 at 2:53 PM -0200, Eden Cardim edencar...@gmail.com wrote:
Charlie == Charlie Garrison garri...@zeta.org.au writes:
Charlie I've never bothered to find out why, but I've run into
Charlie situations where $c-user_exists returns true and $c-user
Charlie returns false.
Charlie == Charlie Garrison garri...@zeta.org.au writes:
Charlie I use a :AuthRequired method attribute and check for that
Charlie in auto method. Is there anything inherently wrong with
Charlie that method? I got the technique from someone on this list
Charlie a while back.
17 matches
Mail list logo