Cml\Cml::requireFile PHP Method

requireFile() public static method

require 引入文件
public static requireFile ( string $file, array $args = [] ) : mixed
$file string 要引入的文件
$args array 要释放的变量
return mixed
    public static function requireFile($file, $args = [])
    {
        empty($args) || extract($args, EXTR_PREFIX_SAME, "xxx");
        Cml::$debug && Debug::addTipInfo($file, Debug::TIP_INFO_TYPE_INCLUDE_FILE);
        return require $file;
    }

Usage Example

Esempio n. 1
0
 /**
  * 显示404页面
  *
  * @param string $tpl 模板路径
  *
  * @return void
  */
 public static function show404Page($tpl = null)
 {
     self::sendHttpStatus(404);
     is_null($tpl) && ($tpl = Config::get('404_page'));
     is_file($tpl) && Cml::requireFile($tpl);
     exit;
 }
All Usage Examples Of Cml\Cml::requireFile