add automatic proxy system for passing objects to Template::Toolkit
This commit is contained in:
parent
6dfeb6ef1a
commit
0a09ea4895
4 changed files with 187 additions and 47 deletions
22
lib/WebGUI/Template/Proxy/Asset.pm
Normal file
22
lib/WebGUI/Template/Proxy/Asset.pm
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package WebGUI::Template::Proxy::Asset;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'WebGUI::Template::Proxy';
|
||||
|
||||
sub _get_allowed {
|
||||
my $self = shift;
|
||||
my $asset = shift;
|
||||
my @properties = $asset->meta->get_all_property_list;
|
||||
return @properties;
|
||||
}
|
||||
|
||||
sub parent {
|
||||
my $self = shift;
|
||||
my $parent = $self->{_asset}->parentNode;
|
||||
$self->_wrap($parent);
|
||||
return $parent;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue