I want to use the question mark in the auto-genera

2019-09-05 07:36发布

问题:

I want to use the question mark the automatically generated path aliases, but when I write the question mark, it is changed to %3f.

How can I fix this?

回答1:

The URL you are trying to use appears to be used as a proper delimiter of path vs. query string. You should not attempt to add the question mark yourself, but instead implement the section after the question mark as query string. For example:

l(t('My Link'), 'campaign/resurfacing-seminar', array(
  'query' => array(
    'campid' => '70150000000Tbdk',
    'eloqua' => 'SEM-110604-SyracuseNY-Lowe',
  ),
));


回答2:

Drupal's url() function is better if you are incorporating it in a form action or a drupal_goto() function.

Here is the link to the function explanation: http://api.drupal.org/api/drupal/includes--common.inc/function/url/6



回答3:

You really can't if you want things to work correctly. The "?" is a special character that signifies the end of the URI and the beginning of the query string. Doing what you suggest would break a lot of your other drupal pages.