First the "jokes"
That is not perl :)
So... How to access helpers and other Mojolicious stuff from outside of controller? Thank you for help!
Learn perl :)
Now back to the question :)
... my $ext = SUi::Ext->new();
Why are you creating another controller instance inside a controller? Why aren't you passing any arguments to the constructor?
https://metacpan.org/pod/Mojolicious::Controller#ATTRIBUTES
Lets see what the source tells us
$ perldoc -l Mojolicious ...\site\lib\Mojolicious.pm $ ack "con\S+\bnew" -in ...\site\lib\mojo* ... ...\site\lib\Mojolicious.pm 73: = $self->controller_class->new(app => $self, stash => $stash, t +x => $tx); 531: my $c = $app->build_controller(Mojo::Transaction::HTTP->new); 532: my $c = $app->build_controller(Mojolicious::Controller->new); 560: $app->dispatch(Mojolicious::Controller->new); 569: $app->handler(Mojolicious::Controller->new);
Hmm $self->controller_class->new(app => $self, stash => $stash, tx => $tx);
Maybe you simply want to subclass SUi::Ext, to make SUi::Ui a subclass of SUi::Ext, as in use Mojo::Base 'SUi::Ext';
In reply to Re: Mojolicious Helpers outside of contollers
by Anonymous Monk
in thread Mojolicious Helpers outside of contollers
by MayVortex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |