我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

导入php文件

I have two PHP files. The first:

<?php
use App\Router as Route;
include "routes.php";
...

The second 'routes.php' file:

<?php
Route::get('/', 'function(){echo "homepage";}');
...

But when I run it I get an error. I have to add: use App\Route as Route for the Routes.php file to work.

Is there a way to include routes.php into the first PHP file without adding use App\Route as Route at the top of the file since its being included in the first file that is importing it? I'm using PHP7.0

近期文章

  • 使用MongoDB和PHP
  • 短代码 - Wordpress
  • 合并自定义2数组
  • PHP中的字符串到[重复]
  • 会话或Cookie [PHP]
  • 一个php文件作为img src
  • 我想要显示数组
  • redis中内嵌lua版本的问题
  • ServletRequest如何取值?
  • C#nopi操作excel文件读取内容
  • android studio 进行简单广播的运行出现问题
  • 如果将keras情感分析模型应用到Java Web上,那Web后台怎么预处理字符串并转化为特征向量?
  • jdk13安装后没有jre?
  • socket客户端如何主动断开与服务器的连接
  • 为什么eclipse启动时报错?
  • 以管理员身份cmd启动mongodb仍然发生系统错误5,如何解决?
  • 那位高手遇到过这种问题
  • 关于python网络爬虫多线程下载图片到本地的问题
  • Java语言怎么比较4个数,,按照从大到小反序,如果不用循环用变量的话,怎么来比较
  • 高分悬赏,用Java语言的compareTo实现的比较和大于号小于号的区别

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华