On 1/31/07 5:11 AM, Michael Lackhoff wrote:
> This is a question I have for some time now: How to get your framework object
> into the depth of all the RDBO and RHTMLO objects (DB table/manager, HTML
> forms, special fields). I use CGI::Application as my framework and Template
> Toolkit as my templating engine and it is so helpful to have the
> CGI::Application object within the template as 'c'. So I can just say
> c.session.param('something'). Thanks Cees!
> Are there any similar solutions out there for the Rose family of Objects? E.g.
> I need something to list the dates of the currently logged in user. At the
> moment I have to explicitely pass the CGI::Application object (or the id of
> the user). It would be so helpful if it was already there somehow.

I don't use CGI::Application, so maybe I'm misunderstanding how it works,
but how about a class method that returns the current CGI::Application
object?  e.g., MyWebSite->current_app().  You'd set it at the beginning of
each request.  Then, in your common RDBO base class, just add a method:

    sub app { MyWebSite->current_app }

and now you can get at it from any RDBO object.


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
Rose-db-object mailing list

Reply via email to