登录

PHP路径引用设置

Controller文件下ServerinfoController.class.php

<?php

namespace Admin\Controller;

use Think\Controller;

class ServerinfoController extends controller{

public function Serverinfo(){

require 'info.php';

$this->display();

}

}

?>

info.php这文件路径怎么写,可以引用View/con,con文件夹下info.php路径.而不是引用根目录www下info.php

# PHP
学容错 学容错 1988 天前 824 次浏览

全部回复(1) 我要回复

  • 胤彬-

    胤彬-2018-10-19 21:06:40

    TP5.0&nbsp;ROOT_PATH变量获取项目根目录 TP5.1&nbsp;Env::get(&#39;app_path&#39;)获取项目根目录多看看TP5的官方文档

    回复
    0
  • 取消 回复 发送