urlencode
過濾器可以對URL參數(shù)進行轉(zhuǎn)義。
iriencode
過濾器可以對url參數(shù)進行轉(zhuǎn)義,除了/#%[]=:;$&()+,!?*@‘~
外的其他字符,都會被按照 URL參數(shù)轉(zhuǎn)義方式進行轉(zhuǎn)義。
urlencode
過濾器的使用方法:
}
iriencode
過濾器的使用方法:
}
比如需要將 ?foo=123&bar=yes
轉(zhuǎn)義,則可以這么寫:
}
顯示結(jié)果
http%3A%2F%2Fwww.example.org%2Ffoo%3Fa%3Db%26c%3Dd
}
}
顯示結(jié)果
http%3A%2F%2Fwww.example.org%2Ffoo%3Fa%3Db%26c%3Dd
?foo=123&bar=yes