【发布时间】:2013-02-05 08:18:08
【问题描述】:
我正在使用 drupal 的 l() 函数来构建链接。所以我将此变量作为第二个参数传递,该函数将从中生成 href 值。
$performer = $row->node_field_data_field_evenement_performer_title;
$url = 'node/' . $row->node_field_data_field_evenement_performer_nid . '/lightbox2';
print l($performer, $url, array('html' => TRUE, 'attributes' => array('rel' => 'lightframe[group|width:500px; height: 500px][caption]', 'class' => 'performer-link')));
URL 应以查询字符串 ?format=simple 结尾。所以基本上我的$url 变量应该更新如下:
$url = 'node/' . $row->node_field_data_field_evenement_performer_nid . '/lightbox2?format=simple';
无论我使用什么编码/解码函数,无论我做什么转义,问号和等号都会被解释为%25 类型的字符。
我试过了:
$url = 'node/' . $row->node_field_data_field_evenement_performer_nid . '/lightbox2\?format\=simple');
或
'/lightbox2' . any_decode_or_encode_function_outthere('?format=simple');
但我不断收到像node/202/lightbox2%5C%3Fformat%5C%3Dsimple 这样的网址。
【问题讨论】: