Php SilverStripe FullTextSearch更改模板renderWith

Php SilverStripe FullTextSearch更改模板renderWith,php,full-text-search,silverstripe,Php,Full Text Search,Silverstripe,我似乎无法更改results函数使用的模板。我使用了results函数并修改了模板,但它是用Page.ss而不是MyCustomResultTemplate.ss呈现的 public function results($data, $form, $request) { // [...] $templates = array( 'MyCustomResultTemplate', 'Page' ); return $this->

我似乎无法更改results函数使用的模板。我使用了results函数并修改了模板,但它是用Page.ss而不是MyCustomResultTemplate.ss呈现的

public function results($data, $form, $request)
{
    // [...]

    $templates = array(
        'MyCustomResultTemplate',
        'Page'
    );

    return $this->owner->customise($data)->renderWith($templates);
}
MyCustomResultTemplate.ss存在于正确的templates文件夹中,看起来与默认页面_results.ss文件完全相同,但仍然不走运


我是不是错过了一些路线设置或者什么

您是否在控制器的扩展中运行此代码?你脸红了吗?MyCustomResultTemplate.ss的路径是什么?不,仅在标准控制器中,对刷新是,并将客户模板放入两个模板中,模板/布局都具有相同的结果。$this->owner用于扩展,请尝试
return$this->customize($data)->renderWith($templates)相反。是的,我也这么认为,但该代码来自Silverstripe编写的另一个控制器,因此对此也有点困惑。早上我会试试你的推荐,干杯你在控制器的扩展中运行这个代码吗?你脸红了吗?MyCustomResultTemplate.ss的路径是什么?不,仅在标准控制器中,对刷新是,并将客户模板放入两个模板中,模板/布局都具有相同的结果。$this->owner用于扩展,请尝试
return$this->customize($data)->renderWith($templates)相反。是的,我也这么认为,但该代码来自Silverstripe编写的另一个控制器,因此对此也有点困惑。早上我会试试你的推荐,干杯