[Catalyst] Accessing $c from Model

Eden Cardim edencardim at gmail.com
Wed Dec 27 16:32:01 GMT 2006


On 12/27/06, Mark Zealey <mark at itsolve.co.uk> wrote:
> Hi there,
>
> I'm basically wanting to write a simple log function which logs hits on my
> website as entries in a database (automatically adding $c->user->{id} and
> $c->req->referrer etc), but to do so I want to use a model (I think). Any
> ideas how I can just say $c->model('Log')->info("foo") and automatically get
> $c passed in?

What's wrong with $c->forward('Model::Log', 'info', ['foo']) ?

-- 
Eden Cardim
Instituto Baiano de Biotecnologia
Núcleo de Biologia Computacional e Gestão de Informações Biotecnológicas
Laboratório de Bioinformática
--
"you seem to think that 'close enough' is close enough...
please learn to be 'literal' around programming."
merlyn - on irc.freenode.net#perl



More information about the Catalyst mailing list