annotate Lib/IMPL/Web/ViewResult.pm @ 260:2879cdb6b8cd

sync
author sergey
date Tue, 25 Dec 2012 02:18:59 +0400
parents 32aceba4ee6d
children 6b6d4b2275a1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
241
f48a1a9f4fa2 +Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff changeset
1 package IMPL::Web::ViewResult;
f48a1a9f4fa2 +Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff changeset
2 use strict;
f48a1a9f4fa2 +Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff changeset
3
f48a1a9f4fa2 +Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff changeset
4 use IMPL::Const qw(:prop);
260
sergey
parents: 256
diff changeset
5 use Carp qw(carp);
241
f48a1a9f4fa2 +Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff changeset
6
f48a1a9f4fa2 +Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff changeset
7 use IMPL::declare {
f48a1a9f4fa2 +Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff changeset
8 base => [
f48a1a9f4fa2 +Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff changeset
9 'IMPL::Object' => undef,
f48a1a9f4fa2 +Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff changeset
10 'IMPL::Object::Autofill' => '@_'
f48a1a9f4fa2 +Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff changeset
11 ],
f48a1a9f4fa2 +Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff changeset
12 props => [
244
a02b110da931 refactoring
sergey
parents: 241
diff changeset
13 model => PROP_RW,
260
sergey
parents: 256
diff changeset
14 _location => PROP_RW,
256
32aceba4ee6d corrected ViewHandlers to handle cookies and headers.
sergey
parents: 244
diff changeset
15 cookies => PROP_RW,
32aceba4ee6d corrected ViewHandlers to handle cookies and headers.
sergey
parents: 244
diff changeset
16 headers => PROP_RW,
32aceba4ee6d corrected ViewHandlers to handle cookies and headers.
sergey
parents: 244
diff changeset
17 status => PROP_RW
241
f48a1a9f4fa2 +Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff changeset
18 ]
f48a1a9f4fa2 +Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff changeset
19 };
f48a1a9f4fa2 +Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff changeset
20
260
sergey
parents: 256
diff changeset
21 sub location {
sergey
parents: 256
diff changeset
22 carp "location property is absolute";
sergey
parents: 256
diff changeset
23 return shift->_location(@_);
sergey
parents: 256
diff changeset
24 }
sergey
parents: 256
diff changeset
25
244
a02b110da931 refactoring
sergey
parents: 241
diff changeset
26 1;
a02b110da931 refactoring
sergey
parents: 241
diff changeset
27
a02b110da931 refactoring
sergey
parents: 241
diff changeset
28 __END__
a02b110da931 refactoring
sergey
parents: 241
diff changeset
29
a02b110da931 refactoring
sergey
parents: 241
diff changeset
30 =pod
a02b110da931 refactoring
sergey
parents: 241
diff changeset
31
a02b110da931 refactoring
sergey
parents: 241
diff changeset
32 =head1 NAME
a02b110da931 refactoring
sergey
parents: 241
diff changeset
33
a02b110da931 refactoring
sergey
parents: 241
diff changeset
34 C<IMPL::Web::ViewResult> - описание представления результата.
a02b110da931 refactoring
sergey
parents: 241
diff changeset
35
a02b110da931 refactoring
sergey
parents: 241
diff changeset
36 =head1 SYNOPSIS
a02b110da931 refactoring
sergey
parents: 241
diff changeset
37
a02b110da931 refactoring
sergey
parents: 241
diff changeset
38 =begin code
a02b110da931 refactoring
sergey
parents: 241
diff changeset
39
a02b110da931 refactoring
sergey
parents: 241
diff changeset
40 sub HttpGet {
a02b110da931 refactoring
sergey
parents: 241
diff changeset
41 my ($this, $action) = @_;
a02b110da931 refactoring
sergey
parents: 241
diff changeset
42
a02b110da931 refactoring
sergey
parents: 241
diff changeset
43 return IMPL::Web::ViewResult->new(
260
sergey
parents: 256
diff changeset
44 model => $model
244
a02b110da931 refactoring
sergey
parents: 241
diff changeset
45 );
a02b110da931 refactoring
sergey
parents: 241
diff changeset
46 }
a02b110da931 refactoring
sergey
parents: 241
diff changeset
47
a02b110da931 refactoring
sergey
parents: 241
diff changeset
48 =end code
a02b110da931 refactoring
sergey
parents: 241
diff changeset
49
a02b110da931 refactoring
sergey
parents: 241
diff changeset
50 =head1 DESCRIPTION
a02b110da931 refactoring
sergey
parents: 241
diff changeset
51
a02b110da931 refactoring
sergey
parents: 241
diff changeset
52 Сожержит в себе информацию для представления модели.
a02b110da931 refactoring
sergey
parents: 241
diff changeset
53
a02b110da931 refactoring
sergey
parents: 241
diff changeset
54 =head1 MEMBERS
a02b110da931 refactoring
sergey
parents: 241
diff changeset
55
a02b110da931 refactoring
sergey
parents: 241
diff changeset
56 =head2 C<[get,set]model>
a02b110da931 refactoring
sergey
parents: 241
diff changeset
57
a02b110da931 refactoring
sergey
parents: 241
diff changeset
58 Модель ресурса, как правило это результат выполнения C<Http> метода.
a02b110da931 refactoring
sergey
parents: 241
diff changeset
59
256
32aceba4ee6d corrected ViewHandlers to handle cookies and headers.
sergey
parents: 244
diff changeset
60 =head2 C<[get,set]cookies>
32aceba4ee6d corrected ViewHandlers to handle cookies and headers.
sergey
parents: 244
diff changeset
61
32aceba4ee6d corrected ViewHandlers to handle cookies and headers.
sergey
parents: 244
diff changeset
62 Хеш с печеньками, которые будут добавлены в C<HTTP> ответ.
32aceba4ee6d corrected ViewHandlers to handle cookies and headers.
sergey
parents: 244
diff changeset
63
32aceba4ee6d corrected ViewHandlers to handle cookies and headers.
sergey
parents: 244
diff changeset
64 =head2 C<[get,set]headers>
32aceba4ee6d corrected ViewHandlers to handle cookies and headers.
sergey
parents: 244
diff changeset
65
32aceba4ee6d corrected ViewHandlers to handle cookies and headers.
sergey
parents: 244
diff changeset
66 Заголовки которые нужно добавить в заголовки C<HTTP> ответа.
32aceba4ee6d corrected ViewHandlers to handle cookies and headers.
sergey
parents: 244
diff changeset
67
32aceba4ee6d corrected ViewHandlers to handle cookies and headers.
sergey
parents: 244
diff changeset
68 =head2 C<[get,set]status>
32aceba4ee6d corrected ViewHandlers to handle cookies and headers.
sergey
parents: 244
diff changeset
69
32aceba4ee6d corrected ViewHandlers to handle cookies and headers.
sergey
parents: 244
diff changeset
70 Код C<HTTP> ответа.
244
a02b110da931 refactoring
sergey
parents: 241
diff changeset
71
a02b110da931 refactoring
sergey
parents: 241
diff changeset
72 =cut