Marcus Ramberg > Catalyst-Runtime-5.7008 > Catalyst::Utils

Download:
Catalyst-Runtime-5.7008.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  23
Open  15
Stalled  1
View/Report Bugs
Source   Latest Release: Catalyst-Runtime-5.90079_003

NAME ^

Catalyst::Utils - The Catalyst Utils

SYNOPSIS ^

See Catalyst.

DESCRIPTION ^

METHODS ^

appprefix($class)

    MyApp::Foo becomes myapp_foo

class2appclass($class);

    MyApp::Controller::Foo::Bar becomes MyApp
    My::App::Controller::Foo::Bar becomes My::App

class2classprefix($class);

    MyApp::Controller::Foo::Bar becomes MyApp::Controller
    My::App::Controller::Foo::Bar becomes My::App::Controller

class2classsuffix($class);

    MyApp::Controller::Foo::Bar becomes Controller::Foo::Bar

class2env($class);

Returns the environment name for class.

    MyApp becomes MYAPP
    My::App becomes MY_APP

class2prefix( $class, $case );

Returns the uri prefix for a class. If case is false the prefix is converted to lowercase.

    My::App::Controller::Foo::Bar becomes foo/bar

class2tempdir( $class [, $create ] );

Returns a tempdir for a class. If create is true it will try to create the path.

    My::App becomes /tmp/my/app
    My::App::C::Foo::Bar becomes /tmp/my/app/c/foo/bar

home($class)

Returns home directory for given class.

prefix($class, $name);

Returns a prefixed action.

    MyApp::Controller::Foo::Bar, yada becomes foo/bar/yada

request($uri)

Returns an HTTP::Request object for a uri.

ensure_class_loaded($class_name)

Loads the class unless it already has been loaded.

merge_hashes($hashref, $hashref)

Base code to recursively merge two hashes together with right-hand precedence.

env_value($class, $key)

Checks for and returns an environment value. For instance, if $key is 'home', then this method will check for and return the first value it finds, looking at $ENV{MYAPP_HOME} and $ENV{CATALYST_HOME}.

AUTHOR ^

Sebastian Riedel, sri@cpan.org Yuval Kogman, nothingmuch@woobling.org

COPYRIGHT ^

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: