add "asset" property to AssetHelpers.
Simplifies the API and allows us to have getForm and getUrl to make asset helpers easier to build.
This commit is contained in:
parent
df31c13e13
commit
698f40a6dd
23 changed files with 216 additions and 123 deletions
|
|
@ -89,11 +89,11 @@ sub handler {
|
|||
my $helperId = $session->form->get('helperId');
|
||||
my $class = $asset->getHelpers->{ $helperId }->{ className };
|
||||
WebGUI::Pluggable::load( $class );
|
||||
my $helper = $class->new( id => $helperId, session => $session );
|
||||
my $helper = $class->new( id => $helperId, session => $session, asset => $asset );
|
||||
|
||||
my $method = $session->form->get('method') || "view";
|
||||
if ( $helper->can( "www_" . $method ) ) {
|
||||
return $helper->can( "www_" . $method )->( $helper, $asset );
|
||||
return $helper->can( "www_" . $method )->( $helper );
|
||||
}
|
||||
else {
|
||||
$session->log->error( sprintf 'Invalid asset helper "%s" calling method "%s"', $helperId, $method );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue