You can set up actual globals:

http://www.masonhq.com/docs/manual/Admin.html#global_variables

Though I prefer to prefix all globals with an app prefix for  
readability, e.g.

$MyApp::msg

On Dec 5, 2007, at 11:30 AM, Anthony Ettinger wrote:

> I have an object (contains UI messaging interface) that I want to
> persist throughout all the mason parts/includes in a request.
>
> How should I do this?
>
> autohandler?:
> my $msg = new UI::Msg;
>
> so from within any part, file, or page now has access to $msg object:
>
> An example below:
>
> /parts/foo
> $msg->err("There was an error with FOO");
>
> /parts/bar
> $msg->ok("Bar processed correctly!");
>
> /autohandler:
> print $msg->errors();
>
>
> Similar to the global $m (mason object)...I do not want to have to
> pass $msg object explicitly to all my files.
>
> -- 
> Anthony Ettinger
> 408-656-2473
> http://anthony.ettinger.name
>
> var (bonita, farley) = new Dog;
> farley.barks("very loud");
> bonita.barks("at strangers");
>
> ---------------------------------------------------------------------- 
> ---
> SF.Net email is sponsored by: The Future of Linux Business White Paper
> from Novell.  From the desktop to the data center, Linux is going
> mainstream.  Let it simplify your IT future.
> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
> _______________________________________________
> Mason-users mailing list
> Mason-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mason-users
>


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to