This file contains hidden or 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 Example::Controller::Register; | |
use Moose; | |
use MooseX::MethodAttributes; | |
use Example::Syntax; | |
extends 'Example::Controller'; | |
has registration => (is=>'ro', lazy=>1, default=>sub($self) { $self->ctx->users->registration } ); | |
has view => (is=>'ro', lazy=>1, default=>sub($self) { $self->ctx->view('HTML::Register', registration => $self->registration } ); |
This file contains hidden or 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 Example::View::HTML::Todos; | |
use Moose; | |
use Example::Syntax; | |
use Valiant::HTML::TagBuilder 'div', 'fieldset', 'table', 'thead','trow', 'tbody', 'td', 'th', 'a', 'b', 'u', ':utils'; | |
use Valiant::HTML::Form 'form_for'; | |
use CatalystX::Wire 'wire', 'Controller'; | |
extends 'Example::View::HTML'; |
This file contains hidden or 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::Controller::Account; | |
sub update_account | |
:Does(RequestModel) | |
:RequestModel(AccountRequest) | |
:Does(RenderErrors) | |
:Errors(BadCSRFToken, InvalidJSON) | |
($self, $c, $request) | |
{ | |
## etc |
This file contains hidden or 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 Example::Controller::Register; | |
use Moose; | |
use MooseX::MethodAttributes; | |
use Example::Syntax; | |
extends 'Example::ControllerPerRequest', | |
'Example::ViewModelController'; | |
has registration => ( |
This file contains hidden or 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 Example::Controller::Todos; | |
use Moose; | |
use MooseX::MethodAttributes; | |
use Example::Syntax; | |
use CatalystX::Controller::ACCEPT_CONTEXT::DependencyInjectionImports; | |
use HTTP::Status 'HTTP_OK', 'HTTP_BAD_REQUEST'; | |
use Example::Types 'TodoResultset', 'TodoResult'; | |
extends 'CatalystX::Controller::ACCEPT_CONTEXT'; |
This file contains hidden or 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 Example::Controller::Todos; | |
use Moose; | |
use MooseX::MethodAttributes; | |
use Example::Syntax; | |
extends 'Catalyst::Controller'; | |
sub root :Chained(/auth) PathPart('todos') CaptureArgs(0) ($self, $c) { | |
$c->send(my $list = $c->user->todos); |
This file contains hidden or 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 Example::Controller::Todos; | |
use Moose; | |
use MooseX::MethodAttributes; | |
use Example::Syntax; | |
extends 'Catalyst::Controller'; | |
sub root :Chained(/auth) PathPart('todos') CaptureArgs(0) ($self, $c) { } |
This file contains hidden or 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 Example::Controller::Register; | |
use Moose; | |
use MooseX::MethodAttributes; | |
use Example::Syntax; | |
extends 'Catalyst::ControllerPerRequest'; | |
has person => ( | |
is=>'ro', |
This file contains hidden or 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
use warnings; | |
use strict; | |
use Class::Method::Modifiers; | |
sub myfunc1 { | |
return join(' ', @_); | |
} | |
sub myfunc2 { | |
return join(' ', @_) .' | '. myfunc1('a','b') |
This file contains hidden or 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 Local::MyApp::Model::User; | |
use Moose; | |
use Valiant::Params -types; | |
has 'first_name' => (is=>'ro', required=>1, param=>1); | |
has 'last_name' => (is=>'ro', required=>1, param=>1); | |
has 'profile' => (is=>'ro', required=>1, param=>{type=>'::Profile'}); | |
sub register_type { |