You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Does anybody has experiences in sub-classing Mojolicious::Renderer?
I want to use Template Toolkit and have some includes to be used in different templates. These include files cannot be loaded by the standard renderer because it always appends the format and renderer type as file extensions (like include.html.tt2). I named the file just "include" because it has nothing to do with html. My next step was to create a new renderer class MyApp::Renderer that inherits from Mojolicious::Renderer to override the method template_path to remove the file extensions for the TT2 include directories. If I do so I get: Mojo::Reactor::EV: I/O watcher failed: Can't use an undefined value as a subroutine reference at /usr/lib/perl5/site_perl/5.26.1/Mojolicious/Controller.pm line 109.
What is the right way to sub-class Mojolicious::Renderer? Can anybody help me with some advise?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
Does anybody has experiences in sub-classing Mojolicious::Renderer?
I want to use Template Toolkit and have some includes to be used in different templates. These include files cannot be loaded by the standard renderer because it always appends the format and renderer type as file extensions (like include.html.tt2). I named the file just "include" because it has nothing to do with html. My next step was to create a new renderer class MyApp::Renderer that inherits from Mojolicious::Renderer to override the method template_path to remove the file extensions for the TT2 include directories. If I do so I get:
Mojo::Reactor::EV: I/O watcher failed: Can't use an undefined value as a subroutine reference at /usr/lib/perl5/site_perl/5.26.1/Mojolicious/Controller.pm line 109.
What is the right way to sub-class Mojolicious::Renderer? Can anybody help me with some advise?
Beta Was this translation helpful? Give feedback.
All reactions