如果请求来自Silverstripe CMS,最好的方法是什么?

问题描述 投票:0回答:1

如果您想要在Silverstripe框架中提供CMS的请求(而不是“前端”),那么最好的方法是什么?

public function IsAdmin()
{
    return Controller::curr() instanceof LeftAndMain ? true : false;
}
silverstripe
1个回答
1
投票

那这个呢 ?

if (is_subclass_of(Controller::curr(), "LeftAndMain"))
© www.soinside.com 2019 - 2024. All rights reserved.