如何在Silverstripe 4中获得可能的模板候选列表?
在开发SilverStripe 4项目时,我发现获得给定覆盖的所有可能候选项的列表有些复杂 因此,我的问题是:如何在Silverstripe 4中获得可能的模板候选列表?,silverstripe,silverstripe-4,Silverstripe,Silverstripe 4,在开发SilverStripe 4项目时,我发现获得给定覆盖的所有可能候选项的列表有些复杂 因此,我的问题是: 如何获取给定页面的可能模板候选的完整列表?在控制器中,您可以在控制器本身或数据记录上调用方法getViewerTemplates,因为getViewerTemplates是ViewableData上的方法 $this->dataRecord->getViewerTemplates(); $this->dataRecord->getViewerTemplates(
如何获取给定页面的可能模板候选的完整列表?在控制器中,您可以在控制器本身或
数据记录上调用方法getViewerTemplates
,因为getViewerTemplates
是ViewableData
上的方法
$this->dataRecord->getViewerTemplates();
$this->dataRecord->getViewerTemplates($action); //If you're calling an action
$this->getViewerTemplates(); //If you don't have a datarecord
实际上,所有这些都是在SSViewer
上实现的方法
我想它会回报你所需要的