You are here

function example_url_query_parameter in Coder 7.2

Same name and namespace in other branches
  1. 7 coder_upgrade/tests/old/samples/example.module \example_url_query_parameter()

File

coder_upgrade/tests/old/samples/example.module, line 2930

Code

function example_url_query_parameter() {

  // Nothing to change.
  $url = url("node/1");
  $url = url("node/1", array(
    "absolute" => TRUE,
  ));

  // Query parameter is a string.
  $url = url("node/1", array(
    "query" => "a=b&c=d%40e",
  ));
  $url = url("node/1", array(
    "absolute" => TRUE,
    "query" => "a=b&c=d%40e",
  ));
  $url = url('node/1', array(
    'absolute' => TRUE,
    'query' => 'a=b&c[]=d&c[]=e',
  ));
  $url = url("node/1", array(
    "alias" => TRUE,
    "query" => "a=b&c=d%40e",
    "fragment" => 'test',
  ));

  // Query parameter is an array.
  $url = url("node/1", array(
    'query' => array(
      'a' => 'b',
      'c' => 'd%40e',
    ),
  ));
  $url = url('node/1', array(
    'absolute' => TRUE,
    'query' => array(
      'a' => 'b',
      'c' => array(
        'd',
        'e',
      ),
    ),
  ));
  $url = url("node/1", array(
    "alias" => TRUE,
    "query" => array(
      'a' => 'b',
      'c' => 'd%40e',
    ),
    "fragment" => 'test',
  ));
}