1HTML::Mason::ComponentSUosuerrceC(o3n)tributed Perl DocuHmTeMnLt:a:tMiaosnon::ComponentSource(3)
2
3
4
6 HTML::Mason::ComponentSource - represents information about an compo‐
7 nent
8
10 my $info = $resolver->get_info($comp_path);
11
13 Mason uses the ComponentSource class to store information about a
14 source component, one that has yet to be compiled.
15
17 new This method takes the following arguments:
18
19 * comp_path
20 The component's component path.
21
22 * last_modified
23 This is the last modificatoin time for the component, in Unix
24 time (seconds since the epoch).
25
26 * comp_id
27 This is a unique id for the component used to distinguish two
28 components with the same name in different component roots.
29
30 If your resolver does not support multiple component roots,
31 this can simply be the same as the "comp_path" key or it can be
32 any other id you wish.
33
34 This value will be used when constructing filesystem paths so
35 it needs to be something that works on different filesystems.
36 If it contains forward slashes, these will be converted to the
37 appropriate filesystem-specific path separator.
38
39 In fact, we encourage you to make sure that your component ids
40 have some forward slashes in them or also all of your generated
41 object files will end up in a single directory, which could
42 affect performance.
43
44 * comp_class
45 The component class into which this particular component should
46 be blessed when it is created. This must be a subclass of
47 "HTML::Mason::Component", which is the default.
48
49 * friendly_name
50 This is used when displaying error messages related to the com‐
51 ponent, like parsing errors. This should be something that
52 will help whoever sees the message identify the component. For
53 example, for component stored on the filesystem, this should be
54 the absolute path to the component.
55
56 * source_callback
57 This is a subroutine reference which, when called, returns the
58 component source.
59
60 The reasoning behind using this parameter is that it helps
61 avoid a profusion of tiny little "HTML::Mason::ComponentSource"
62 subclasses that don't do very much.
63
64 * extra
65 This optional parameter should be a hash reference. It is used
66 to pass information from the resolver to the component class.
67
68 This is needed since a "HTML::Mason::Resolver" subclass and a
69 "HTML::Mason::Component" subclass can be rather tightly cou‐
70 pled, but they must communicate with each through the inter‐
71 preter (this may change in the future).
72
73 comp_path
74 last_modified
75 comp_id
76 comp_class
77 friendly_name
78 extra
79 These are all simple accessors that return the value given to the
80 constructor.
81
82 comp_source
83 Returns the source of the component.
84
85 object_code ( compiler => $compiler )
86 Given a compiler, this method returns the object code for the com‐
87 ponent.
88
89 HTML::Mason, HTML::Mason::Admin, HTML::Mason::Component
90
91
92
93perl v5.8.8 2007-04-17 HTML::Mason::ComponentSource(3)