Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将组列表作为 JSON 对象从Sentry::findAllGroups()方法中获取。知道怎么做吗?
Sentry::findAllGroups()
使用 Sentry 是不可能的,因为它返回一个组对象数组,但您可以使用纯 PHP 将其转换为 json:
return json_encode(Sentry::findAllGroups());