1Catalyst::Utils(3) User Contributed Perl Documentation Catalyst::Utils(3)
2
3
4
6 Catalyst::Utils - The Catalyst Utils
7
9 See Catalyst.
10
13 appprefix($class)
14
15 MyApp::Foo becomes myapp_foo
16
17 class2appclass($class);
18
19 MyApp::Controller::Foo::Bar becomes MyApp
20 My::App::Controller::Foo::Bar becomes My::App
21
22 class2classprefix($class);
23
24 MyApp::Controller::Foo::Bar becomes MyApp::Controller
25 My::App::Controller::Foo::Bar becomes My::App::Controller
26
27 class2classsuffix($class);
28
29 MyApp::Controller::Foo::Bar becomes Controller::Foo::Bar
30
31 class2env($class);
32
33 Returns the environment name for class.
34
35 MyApp becomes MYAPP
36 My::App becomes MY_APP
37
38 class2prefix( $class, $case );
39
40 Returns the uri prefix for a class. If case is false the prefix is con‐
41 verted to lowercase.
42
43 My::App::Controller::Foo::Bar becomes foo/bar
44
45 class2tempdir( $class [, $create ] );
46
47 Returns a tempdir for a class. If create is true it will try to create
48 the path.
49
50 My::App becomes /tmp/my/app
51 My::App::C::Foo::Bar becomes /tmp/my/app/c/foo/bar
52
53 home($class)
54
55 Returns home directory for given class.
56
57 prefix($class, $name);
58
59 Returns a prefixed action.
60
61 MyApp::Controller::Foo::Bar, yada becomes foo/bar/yada
62
63 request($uri)
64
65 Returns an HTTP::Request object for a uri.
66
67 ensure_class_loaded($class_name, \%opts)
68
69 Loads the class unless it already has been loaded.
70
71 If $opts{ignore_loaded} is true always tries the require whether the
72 package already exists or not. Only pass this if you're either (a) sure
73 you know the file exists on disk or (b) have code to catch the file not
74 found exception that will result if it doesn't.
75
76 merge_hashes($hashref, $hashref)
77
78 Base code to recursively merge two hashes together with right-hand
79 precedence.
80
81 env_value($class, $key)
82
83 Checks for and returns an environment value. For instance, if $key is
84 'home', then this method will check for and return the first value it
85 finds, looking at $ENV{MYAPP_HOME} and $ENV{CATALYST_HOME}.
86
88 Sebastian Riedel, "sri@cpan.org" Yuval Kogman, "nothing‐
89 much@woobling.org"
90
92 This program is free software, you can redistribute it and/or modify it
93 under the same terms as Perl itself.
94
95
96
97perl v5.8.8 2007-09-20 Catalyst::Utils(3)