view Lib/IMPL/Web/TT/Control.pm @ 90:dc1da0389db7

Small improvements in the abstract object class Added support for a class data, documentation Additional tests for the new functionality
author wizard
date Mon, 26 Apr 2010 03:10:03 +0400
parents a5cb84374d40
children 0e72ad99eef7
line wrap: on
line source

package IMPL::Web::TT::Control;

use base qw(IMPL::DOM::Node);

use IMPL::Class::Property;

our %CTOR = (
	'IMPL::DOM::Node' => sub {
		#TODO: Pass arguments
	}
);

BEGIN {
	public property template => prop_all;
}

sub Render {
	my ($this) = @_;
	
	if ($this->document) {
		if ($this->template) {
			return $this->document->context->include($this->template,{ this => $this });
		} elsif ($this->document->presenter) {
			return $this->document->presenter->print($this);
		} else {
			return $this->toString();
		}
	}
}

1;