Created
August 9, 2014 13:33
-
-
Save gabrielmad/741d778ad2e576582eb4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyApp::Plugin::TooCool; | |
use Moo; | |
sub get_something { | |
my ($self, $c, $default) = @_; | |
return $c->param('something') || $default || 'could not find something'; | |
} | |
sub register { | |
my ($self, $app, $config) = @_; | |
$app->helper( $self => 'too_cool' ); | |
} | |
#============================================================================ | |
package MyApp::Controller::User; | |
sub some_action { | |
my $c = shift; | |
$c->render(text => $c->too_cool->get_something(123)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment