Introduction to Mason 24

MVC Apps with Catalyst

package MyApp::Controller::User;

use base 'Catalyst::Controller';

sub view : Path('/user') : Args(1) {
    my ($self, $c, $user_id) = @_;

    $c->stash()->{user} =
        MyApp::User->new( user_id => $user_id );

    # this will be a Mason template
    $c->stash()->{template} = '/user/view';
}

sub create_form : Path { ... }