# -------------------------------------------------------------------------------------
# flo::Template::URIEncode
# -------------------------------------------------------------------------------------
#
#    Author   : Jean-Michel Hiver                                (c) MKDoc Holding Ltd.
#
# -------------------------------------------------------------------------------------
package flo::Template::URIEncode;
use lib::Template::AbstractTag;
use lib::Exception;
use lib::Template;
use lib::cgi::CGI;
use strict;
use vars qw /@ISA/;
@ISA = qw /lib::Template::AbstractTag/;


##
# $obj->main;
# -----------
##
sub main
{
    my $self   = shift;
    my $result = $self->result;
    my $tokens = $self->tokens;
    my ($token_name, $token_hash) = $self->parse_tag (shift @{$tokens});
    
    my $path = $token_hash->{path} or
        throw (new lib::Exception ( code => 'VARIABLE_NOT_SET',
                                    info => "$token_name should have a 'symbol' attribute" ) );
    
    my $cgix = lib::cgi::CGI->get->new;
    $cgix->path_info ($path);
    push @{$result}, $cgix->self_url;
}


1;







