Peter Speltz wrote:
> Why, when looking for templates associated with a class/table, does
> Maypole::View look in a dir named after class's moniker rather than table?
> Since default url processing are based on table why are'nt template paths?
> Also the docs aren't real specific about the fact that moniker is used.
>
> fom M::Manual::View--
> Locating Templates
> . . .
> . . . This is where the
> third directory comes in. The other directory, which May
> pole checks very first of all, is specific to the table
> that you're viewing. So if you go to
> "http://your.shop.com/basket/list", Maypole will look in
> the basket directory first for a file called list, and
> second in the custom directory for a site-wide list tem
> plate, and then fall-back to the factory directory for a
> generic list template.
>
> The example in its simplicity is misleading as under default class dbi a table
> like "note_card" will have a moniker like "notecard" and thus the directory
> "notecard" will be searched.
I'm not sure it's misleading, but it is ambiguous.
> I'm not sure why moniker was used instead of table name. HOwever moniker is
> overrideable so if you decide to change it, you'd need to change names of your
> template directories.
If we document the fact that the view uses the model's moniker for
template paths then that would be expected behaviour.
What are you overriding moniker() to? Or to put it another way, why is
your overriden moniker() unsuitable for a template path?
Apart from the other reason(s) given for using moniker() over table(),
it helps to decouple the view from the model. I'm writing a non-DBI
maypole model class at the moment which doesn't have tables.
--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:57 GMT