Router::getParam PHP Method

getParam() public static method

Gets URL parameter by name
public static getParam ( string $name = 'controller', boolean $current = false ) : string | null
$name string Parameter name
$current boolean Current parameter, useful when using requestAction
return string | null Parameter value
    public static function getParam($name = 'controller', $current = false)
    {
        $params = Router::getParams($current);
        if (isset($params[$name])) {
            return $params[$name];
        }
        return null;
    }

Usage Example

コード例 #1
0
 public function afterFind($results, $primary = false)
 {
     if (!in_array(Router::getParam('action'), ['editar'])) {
         $results = $this->formatDateFields($results, $this->datesToLoad, "%d/%m/%Y %H:%M");
     }
     return $results;
 }
All Usage Examples Of Router::getParam