protected function getPresenterMethodFromVariable($variable) { $method = 'present' . str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $variable))); if (method_exists($this, $method)) { return $method; } }