GX::Action - Action class
# Load the class use GX::Action; # Create a new action object $action = GX::Action->new( controller => 'MyApp::Controller::Blog', method => 'show_post' ); # Call the action method $action->call( $context ); # Dispatch the action $action->dispatch( $context );
This module provides the GX::Action class which extends the GX::Callback class.
new
Returns a new GX::Action object.
$action = GX::Action->new( %attributes );
controller ( GX::Controller object | string ) [ required ]
controller
The class name or instance of the controller component to which the action belongs.
method ( string ) [ required ]
method
The name of the action method.
$action ( GX::Action object )
$action
GX::Exception
call
Calls the action method.
$action->call( $context );
$context ( GX::Context object )
$context
code
Returns a reference to the action method.
$code = $action->code;
$code ( CODE reference )
$code
CODE
Returns the controller component instance to which the action belongs.
$controller = $action->controller;
$controller ( GX::Controller object )
$controller
dispatch
Dispatches the action using the controller's dispatch mechanism.
$action->dispatch( $context );
id
Returns a string identifying the action (not the action object).
$id = $action->id;
$id ( string )
$id
Returns the name of the action.
$method = $action->method;
$method ( string )
$method
name
An alias for method().
method()
$name = $action->name;
$name ( string )
$name
GX::Controller
Jörg A. Uzarek <uzarek@runlevelnull.de>
Copyright (c) 2009-2011 Jörg A. Uzarek.
This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation.
To install GX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GX
CPAN shell
perl -MCPAN -e shell install GX
For more information on module installation, please visit the detailed CPAN module installation guide.