You are here

public function SystemQueryParam::getValues in ThemeKey 8

Return value

array array of system:query_param values

Overrides PropertyInterface::getValues

File

src/Plugin/Property/SystemQueryParam.php, line 28
Contains \Drupal\themekey\Plugin\Property\SystemQueryParam.

Class

SystemQueryParam
Provides a 'query param' property.

Namespace

Drupal\themekey\Plugin\Property

Code

public function getValues() {

  // TODO use safe values from RouteMatch
  $filtered_params = array();
  $query_params = $_GET;

  // unset($query_params['q']);
  foreach ($query_params as $key => $value) {
    $filtered_params[] = $key . (!empty($value) ? '=' . $value : '');
    $filtered_params[$key] = !empty($value) ? $value : '';
  }
  return $filtered_params;
}