Mercurial > pub > Impl
comparison Lib/IMPL/Web/TT/Control.pm @ 140:fb896377389f
to_json and escape_string functions for the templates
minor changes
| author | wizard |
|---|---|
| date | Mon, 05 Jul 2010 02:22:42 +0400 |
| parents | c8dfbbdd8005 |
| children | 4267a2ac3d46 |
comparison
equal
deleted
inserted
replaced
| 139:5a9f64890c31 | 140:fb896377389f |
|---|---|
| 18 sub CTOR { | 18 sub CTOR { |
| 19 my ($this,%args) = @_; | 19 my ($this,%args) = @_; |
| 20 | 20 |
| 21 if ($this->document) { | 21 if ($this->document) { |
| 22 # load a template | 22 # load a template |
| 23 $args{template} = $this->document->context->template($args{template}) if ($args{template} and not ref $args{template}); | 23 $this->template( $this->document->context->template($args{template})) if ($args{template} and not ref $args{template}); |
| 24 } | 24 } |
| 25 #$this->template($args{template}) if $args{template}; | 25 #$this->template($args{template}) if $args{template}; |
| 26 | 26 |
| 27 $this->id($this->nodeName . '-' . $nextId++); | 27 $this->id($this->nodeName . '-' . $nextId++); |
| 28 $this->controlClass($args{controlClass} || 'Control'); | 28 $this->controlClass('Control') unless $this->controlClass; |
| 29 } | 29 } |
| 30 | 30 |
| 31 sub Render { | 31 sub Render { |
| 32 my ($this) = @_; | 32 my ($this) = @_; |
| 33 | 33 |
