PHP opendir()函数问题

JCm*_*JCm 2 php

$result = 'false';
if( opendir( $this->OuterTemplateDirPath != false ) ){
   $result = 'true';
}
return $result;
Run Code Online (Sandbox Code Playgroud)

我有fxn和outertemplate等于$_SERVER['DOCUMENT_ROOT' ] . 'mysite.com/templates/admin/structure/outertemplate/.

但它返回错误说:

Warning: opendir(1) [function.opendir]: failed to open dir: No such file or directory in C:\wamp\www\mysite.com\templates\admin\structure\structure.php on line 411
Run Code Online (Sandbox Code Playgroud)

什么似乎是问题?应该是什么

Dan*_*man 5

你的括号似乎放错了地方.您正在传递一个布尔值(比较模板目录的返回值为false)到opendir()而不是目录.

if (opendir($this->OuterTemplateDirPath) != false) { 
Run Code Online (Sandbox Code Playgroud)