-
-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User Form Templatization #3897
User Form Templatization #3897
Conversation
@@ -38,9 +38,28 @@ | |||
use Storable qw/dclone/; | |||
use Log::Any qw($log); | |||
|
|||
use Template; | |||
use Data::Dumper; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need it in here?
my $type = param('type') || 'add'; | ||
my $action = param('action') || 'display'; | ||
|
||
|
||
# Initialize the Template module | ||
my $tt = Template->new({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that the initialisation of $tt
and $template_data_ref
is now done several times in Display.pm and some .pl files in the same way. Would it make sense to introduce a new ProductOpener::Template
module with methods that know how to do just that? It could reduce duplicated code and avoid errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hangy : maybe we can just make the $tt in Display.pm an exported variable. Then it's initialize once at module startup, and that's it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Description:
HTML Templatization of User form using Template::Toolkit
Related issues and discussion: #2416