Hi,

This has hit me a few times, and I've just encountered it again, so I
thought it would be good to ask those wiser than I :)

There have been a few times where I could do with querying the
database (which I'd normally do through $c->model), but this is not
available. For example, I've added the option for users to specify how
to display dates on our website, through a variety of formats. I
thought the best way to do this, would be using a Template Toolkit
plugin:

    [% USE user_date %]
    The date is [% user_date.format(some_date) %].

However, this plugin needs to access the user preferences model
($c->model('UserPreference')->date_format($user)). Should I be
instantiating this model (the Catalyst model is a very lightweight
wrapper around a non-catalyst specific model) - or is there a better
option?

- Ollie

_______________________________________________
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: http://dev.catalyst.perl.org/

Reply via email to