yii 用post可以直接传值,但是不能直接用get传值

1 <!-- yii2.0用get方法传值 -->
2 <form action="index.php" method="get">
3     <!-- yii2.0用get方法传值必须加入hidden才可以成功 -->
4     <input type="hidden" name="r" value="控制器名/方法名">
5     <input type="text" name="user">
6     <input type="submit" value="添加">
7 </form>
View Code

<!-- yii2.0用get方法传值 -->
<form action="index.php" method="get">
<!-- yii2.0用get方法传值必须加入hidden才可以成功 -->
<input type="hidden" name="r" value="控制器名/方法名">
<input type="text" name="user">
<input type="submit" value="添加">
</form>

猜你喜欢

转载自www.cnblogs.com/funbaby/p/11067709.html
yii
今日推荐