From 6e45347ba383eed6ed77354546ee946c5959b463 Mon Sep 17 00:00:00 2001 From: Brian Read Date: Thu, 24 Apr 2025 09:59:49 +0100 Subject: [PATCH] Add comment on top about unique routes --- Templates/controller.pm.tem | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Templates/controller.pm.tem b/Templates/controller.pm.tem index bc301f8..7f95650 100644 --- a/Templates/controller.pm.tem +++ b/Templates/controller.pm.tem @@ -1,6 +1,8 @@ package SrvMngr::Controller::${PackageName}; # # Generated by ${version} +# Remember that each route must be unique (else they just overwrite each other). +# you cannot have get and post on the same name and url. # #---------------------------------------------------------------------- # heading : ${MenuHeading} @@ -133,7 +135,7 @@ sub do_update { my $params = $c->req->params->to_hash; # Get number of POST parameters - #my $num_params = keys scaler %$params; + my $num_params = keys scaler %$params; #Params are available in the hash "params" - copy to the prefix_data hash #while (my ($key, $value) = each %{$c->req->params->to_hash}) { @@ -215,10 +217,10 @@ sub do_display { my $modul = ""; # Accessing all parameters - my %params = $c->req->params->to_hash; + my $params = $c->req->params->to_hash; # Get number of parameters - my $num_params = keys %params; + my $num_params = keys %$params; #Tag as Post or Get (ie. create new entry or edit existing one my $is_new_record = ($c->req->method() eq 'POST');