Re: [Maypole] how can I get the third part of the path ?

From: Simon Flack (sf at flacks.net)
Date: Thu Sep 16 2004 - 21:42:43 BST


On Thu, 16 Sep 2004 22:22:17 +0200, Sebastian Riedel wrote
> Gabor Szabo:
>
> >How can I get the id part of the regular Maypole path of /table/view/id ?
> >
> >If id is a number it seems to be the first element of the
> >$t->{args} array but if id is a string it is not there.
> >
> >
> It should be there.

I think it's because Maypole::Model shifts the first param from $r->{args} if
it was able to create an $r->{object} from it.

In my app, it happens the other way round - the first element is missing if
it's a number and present if it's a string.

> >Is there a standard way to get this value ?

If the above is correct, then try $r->{object}[0]->id. where ->id corresponds
to the primary key method of your Class::DBI object.

--simonflk

_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:56 GMT