The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Catalyst::Candy - Sugar for your Catalyst Components

VERSION

version 0.001

SYNOPSIS

  package MyApp::Web::Controller::Root;

  use Catalyst::Candy qw( Controller );

  config namespace => '';

  sub base :Chained('/') :PathPart('') :CaptureArgs(0) {

    if ( my ( $username, $password ) = basic_auth ) {
      auth { username => $username, password => $password, };
    }

    stash title => 'hello';
    session session_var => 'value';

    stash some_var => user->admin;
    stash special => c->app_function;
    stash model_var => model('Bla')->func;

    error "Something bad happened" if param('error_maker');

  }

  ...

  sub end : Action {

    forward( view('TT') );

  }

  done; # equal to => no Moose; __PACKAGE__->meta->make_immutable;

DESCRIPTION

I will go to hell for this...

FUNCTIONS

config

  __PACKAGE__->config(@_)

c

  $c

session

  $c->session(@_)

stash

  $c->stash(@_)

param

  $c->req->param(@_)

params

  $c->req->params(@_)

req

  $c->req

res

  $c->res

args

  shift; shift; return(@_)

auth

  $c->authenticate(@_)

basic_auth

  $c->req->headers->authorization_basic(@_)

user

  $c->user(@_)

redirect

  $c->response->redirect(@_)

status

  $c->response->status(@_)

forward

  $c->forward(@_)

detach

  $c->detach(@_)

visit

  $c->visit(@_)

go

  $c->go(@_)

error

  $c->error(@_)

debug

  $c->debug

log

  my $func = shift; $c->log->$func(@_)

uri_for

  $c->uri_for(@_)

uri_for_action

  $c->uri_for_action(@_)

SEE ALSO

Catalyst

SUPPORT

IRC

  Join #catalyst on irc.perl.org. Highlight Getty for fast reaction :).

Repository

  http://github.com/Getty/p5-catalyst-candy
  Pull request and additional contributors are welcome

Issue Tracker

  http://github.com/Getty/p5-catalyst-candy/issues

AUTHOR

Torsten Raudssus <torsten@raudss.us>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.