search

Home  >  Q&A  >  body text

PHP path reference settings

ServerinfoController.class.php under the

Controller file

<?php

namespace Admin\Controller;

use Think\Controller;


class ServerinfoController extends controller{


public function Serverinfo(){

require 'info.php';

$this->display();

}

}

?>

How to write the file path of info.php, you can refer to View/con, info under the con folder. php path. Instead of referencing info.php### under the root directory www
学容错学容错2228 days ago966

reply all(1)I'll reply

  • 胤彬-

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

    TP5.0 ROOT_PATH variable gets the project root directory TP5.1 Env::get('app_path') gets the project root directory. Read more about the official documentation of TP5

    reply
    0
  • Cancelreply