The URL is generated correctly, but the variable after the parameter code is not parsed
I did not use the built-in template engine of thinkphp. I used samrty instead. The template suffix is .html. Please help me.
曾经蜡笔没有小新2017-05-27 17:46:04
The template tag is wrong, you need to add a colon, {:U(code)}. In addition, single quotes are used in U, so the variable cannot be parsed directly. You need to use . to splice strings! Such as: 'active='.$item[]
習慣沉默2017-05-27 17:46:04
Try this: U('url',array('size'=>14,'thick'=>25,'code'=>$info['CardNo']),false)
This method There are three parameters, please refer to the TP documentation for details
漂亮男人2017-05-27 17:46:04
Your approach is wrong! The access mode of the url. It should be played like this
U('controller/action/size/14') Hard-coded parameter names and parameter values
U('controller/action/size/'.$info['size'].'/id/'.$info ['id']) variable value
U('controller/action').'?id=12&size='.$info['size'] If you want to use ? method.
Because U('controller/action') will generate controller/action.html
So, you should write ? outside U('')