phroute无法正常工作,表示路由未定义

时间:2018-11-21 18:42:12

标签: php routes

我正在使用phroute。

当我使用项目名称作为路由时,它适用于根路由。但是如果我用“ /”之类的话。然后这条路线不起作用。

此路由的工作方式类似于根路由。

par(mfrow=c(3, 1), mar=c(3, 3, 1, 1), mgp=c(2, 0.8, 0), oma=c(0, 0, 2, 0))
plot(as.numeric(names(rmse)), rmse, type="h", xlab="")
plot(as.numeric(names(mae)), mae, type="h", xlab="")
plot(as.numeric(names(smape)), smape, type="h", xlab="Ages")
mtext(paste("Forecast accuracy for the years", 
  paste(cvy[c(1, years.for)], collapse=" - ")), 
  3, outer=TRUE)

这条路线不起作用。并说,通过告诉该项目名称,该路径未定义。例如“未定义电子商务路线”

/*this is working as root route like / */ 
$router->controller('/ecommerce', \App\Controllers\HomeController::class);

我的完整代码在这里。

/* If i run this route it shows , that ecomeerce route not found. */
$router->controller('/', \App\Controllers\HomeController::class);

1 个答案:

答案 0 :(得分:0)

当您以“ http://localhost/ecommerce”的形式访问应用程序的URL时,因此需要添加“ / ecommerce”。

通常,当您将应用程序托管到适当的域时,无需“电子商务”部分即可访问该应用程序。 最好在开发环境中使用虚拟主机来解决此问题。