On Jan 10, 2008, at 1:54 PM, Octavian Rasnita wrote:
From: "Carl Johnstone" <[EMAIL PROTECTED]>
Both the context object and the hostname should be available to
code within MyApp.pm, but only if the code is running during a
request.
Ok, but how to get the hostname during a request in MyApp.pm if a $c
variable is not available?
What you seem to be missing is that (in the current version at least)
MyApp *IS* $c.
package MyApp;
sub get_hostname {
my ( $self ) = @_;
return $self->request->header( 'host' );
}
--
Jason Kohles, RHCA RHCDS RHCE
[EMAIL PROTECTED] - http://www.jasonkohles.com/
"A witty saying proves nothing." -- Voltaire
_______________________________________________
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/