TwigBase: Allow operation param to be in snake case in order to handle/redirect existing operations

This commit is contained in:
Molkobain
2022-11-10 09:23:23 +01:00
parent 4486842169
commit 8c14d36dfe

View File

@@ -165,7 +165,7 @@ abstract class Controller
$this->CheckAccess();
$this->m_sOperation = utils::ReadParam('operation', $this->m_sDefaultOperation);
$sMethodName = 'Operation'.$this->m_sOperation;
$sMethodName = 'Operation'.utils::ToCamelCase($this->m_sOperation);
$oKPI = new ExecutionKPI();
$oKPI->ComputeAndReport('Starting operation '.$this->m_sOperation);
if (method_exists($this, $sMethodName))
@@ -201,7 +201,7 @@ abstract class Controller
$this->CheckAccess();
$this->m_sOperation = utils::ReadParam('operation', $this->m_sDefaultOperation);
$sMethodName = 'Operation'.$this->m_sOperation;
$sMethodName = 'Operation'.utils::ToCamelCase($this->m_sOperation);
if (method_exists($this, $sMethodName))
{
$this->$sMethodName();