访问不到页面

来源:3-8 前台页面设置公共布局(上)

慕慕7355481

2017-05-24

我使用原生的bootstrap建立导航,因为Controller使用了多个单词构成的驼峰形式,我在各个单词之间使用了“-”,但是网页还是访问不到。

<li><a href="<?php echo \yii\helpers\Url::toRoute('equipment-type/index'); ?>">装置类型</a></li>

我的controller是:EquipmentTypeController

action是:actionIndex。

老师,这是为什么呢?

写回答

3回答

Jason

2017-05-25

访问地址应该是http://localhost:8080/jxsenergy/web/index.php?r=equipment-type/index,模板路径名称应该是EquipmentType

1
3
Jason
回复
慕慕7355481
客气了
2017-05-25
共3条回复

慕慕7355481

提问者

2017-05-25

我的views下面的文件夹是equipmentType,

如果访问的是http://localhost:8080/jxsenergy/web/index.php?r=equipment-type/index,那么: the file not find。

如果我访问的是http://localhost:8080/jxsenergy/web/index.php?r=equipmentType/index,那么出现的是404错误

0
0

Jason

2017-05-25

看样子是没错,直接访问这个地址试试

0
1
慕慕7355481
我的views下面的文件夹是equipmentType, 如果访问的是http://localhost:8080/jxsenergy/web/index.php?r=equipment-type/index,那么: the file not find。 如果我访问的是http://localhost:8080/jxsenergy/web/index.php?r=equipmentType/index,那么出现的是404错误
2017-05-25
共1条回复

Yii2.0开发一个仿京东商城平台

【毕设】购物、下单、支付、收货...各功能模块开发,打造京东式电商平台

1543 学习 · 655 问题

查看课程