Mercurial > pub > Impl
comparison Lib/IMPL/Web/QueryHandler/UrlController.pm @ 160:3f09584bf189
Corrected web application modules
| author | wizard |
|---|---|
| date | Mon, 27 Dec 2010 19:41:36 +0300 |
| parents | e6447ad85cb4 |
| children | 4267a2ac3d46 |
comparison
equal
deleted
inserted
replaced
| 159:f8de52d3c112 | 160:3f09584bf189 |
|---|---|
| 14 __PACKAGE__->PassThroughArgs; | 14 __PACKAGE__->PassThroughArgs; |
| 15 | 15 |
| 16 sub Process { | 16 sub Process { |
| 17 my ($this,$action,$nextHandler) = @_; | 17 my ($this,$action,$nextHandler) = @_; |
| 18 | 18 |
| 19 my $namespace = $this->namespace || $action->application->type; | 19 my $namespace = $this->namespace || $action->application->typeof; |
| 20 | 20 |
| 21 my @target = grep $_, split /\//, ($ENV{PATH_INFO} || '') or die new IMPL::Exception("No target specified"); | 21 my @target = grep $_, split /\//, ($ENV{PATH_INFO} || '') or die new IMPL::Exception("No target specified"); |
| 22 | 22 |
| 23 my $method = pop @target; | 23 my $method = pop @target; |
| 24 if ( $method =~ /^(\w+)/ ) { | 24 if ( $method =~ /^(\w+)/ ) { |
| 51 | 51 |
| 52 =pod | 52 =pod |
| 53 | 53 |
| 54 =head1 NAME | 54 =head1 NAME |
| 55 | 55 |
| 56 C<IMPL::Web::QueryHandler::UrlController> - вызов метода на основе <url> запроса. | 56 C<IMPL::Web::QueryHandler::UrlController> - вызов метода на основе C<url> запроса. |
| 57 | 57 |
| 58 =head1 DESCRIPTION | 58 =head1 DESCRIPTION |
| 59 | 59 |
| 60 Использует переменную C<$ENV{PATH_INFO}> для получения имени и метода модуля. | 60 Использует переменную C<$ENV{PATH_INFO}> для получения имени и метода модуля. |
| 61 Например запрос C<http://localhost/User/register.html> интерпретируется как вызов метода C<register> | |
| 62 у модуля C<User>. | |
| 63 | |
| 64 =head1 MEMBERS | |
| 65 | |
| 66 =head2 PROPERTIES | |
| 67 | |
| 68 =over | |
| 69 | |
| 70 =item C<[get,set] namespace> | |
| 71 | |
| 72 Пространство имен в котором находится модуль. по умолчению совпадает с именем класса приложения, например C<My::App> | |
| 73 | |
| 74 =back | |
| 61 | 75 |
| 62 =cut | 76 =cut |
