静态生成好奇怪..

#1 suki



spurl 中 :
{spUrl c=$smarty.get.c a=$smarty.get.a id=$smarty.get.id|default:'0' cattype=$smarty.get.cattype page=$pager.last_page}

url :
http://localhost/test/index.php?c=news&a=index&id=11&cattype=0&page=2

静态路由中的记录:
news|index|{"id":"11","cattype":"0","page":"1"}||/test/sphtml/news_index/11_1.html|E:\APMServ5.2.6\www\htdocs\test/sphtml/news_index/11_1.html

但是 指向 page = 1 时 依然是
http://localhost/test/index.php?c=news&a=index&id=11&cattype=0&page=1
为什么呢???

2012-03-05 11:32:10

#2 jake

需要把 $smarty.get.id 强制转成字符串,因为这边是数字。

这个问题可以搜索论坛,手册上也有相关描述。建议是先查手册,用用例子,谢谢。

2012-03-05 13:02:51

#3 suki

不是哦.. 不是 $smarty.get.id 的问题.. 是pager 类 返回的是 数字类型.

2012-03-05 13:44:18

#4 jake

强制转换成字符串

2012-03-05 13:46:48