我想使用 Request::server('HTTP_HOST') 获取当前域 - 但是当我从帮助程序类中调用它时,它返回为 'localhost' 这不是我想要的。从控制器它按预期工作。有没有办法从帮助类中访问这些信息?
辅助类如下所示:
class ApiWrapper {
public static function call($model, $method='', array $input) {
$domain = Request::server('HTTP_HOST');
}
}