yii2不渲染以查看只是刷新页面
view.php代码零件:
<a href="/goods/viewgood/<?=$good['GoodGallery'][0]['id']?>" class="btn btn-primary">View Picture</a>
viewgood.php
<?php
echo 'hello';
goodscontroller.php
public function viewgood($id = null) {
}
单击按钮查看图片图片我的页面只是刷新而不是转到viewgood.php 我在做什么错误? 我是yii2中的早点
view.php code part:
<a href="/goods/viewgood/<?=$good['GoodGallery'][0]['id']?>" class="btn btn-primary">View Picture</a>
viewgood.php
<?php
echo 'hello';
GoodsController.php
public function viewgood($id = null) {
}
After clicking on button View Picture my page just refreshing instead of going to viewgood.php
What am I doing incorrectly?
I am a begginer in Yii2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试
在锚定标签html中使用您的需求,请使用完整的路线,以便使用快捷方式尝试使用
Try use
in a anchor tag html your need use the complete route, for use shortcut you try use
view.php
您可以使用html:a(),或者在示例中使用url助手到()函数为锚定标签生成适当的路由。
goodscontroller.php
viewgood.php
view.php
You can use Html:a(), or in your example use Url helper to() function to generate the proper route for your anchor tag.
GoodsController.php
viewgood.php