所以,我希望有我的类包含另一个文件,该文件又执行return语句...包括()函数里面:回归工程意外
class layout {
public static function make($file) {
include $file;
}
}
我有一个mylayout.layout.php
<?php
return true;
然后我
echo layout::make('mylayout.layout.php');
结果null
为什么你要在第一线回来? – hek2mgl
你可以有一个return语句。但它不会是包含的函数的返回语句。 (如你所料) – hek2mgl
这是使用特质的初步案例吗?我并不认为他们的价值,但这可能是一个合适的情况 –