如果您想要在Silverstripe框架中提供CMS的请求(而不是“前端”),那么最好的方法是什么?
public function IsAdmin() { return Controller::curr() instanceof LeftAndMain ? true : false; }
那这个呢 ?
if (is_subclass_of(Controller::curr(), "LeftAndMain"))