$result = 'false';
if( opendir( $this->OuterTemplateDirPath != false ) ){
$result = 'true';
}
return $result;
我的 fxn 和外模板等于 $_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
问题出在哪里?应该是什么
最佳答案
你的括号似乎放错地方了。您将 bool 值(将模板目录与 false 进行比较的返回值)传递给 opendir() 而不是目录。
if (opendir($this->OuterTemplateDirPath) != false) {
关于PHP opendir() 函数问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4152117/