【发布时间】:2019-05-10 06:21:21
【问题描述】:
这是Area类函数
public function findLatestReport()
{
$getReport = Report::get()->filter('AreaID',$this->ID)
->sort('Date ASC')->first();
return $getReport;
}
这是报表类函数
public function getWeatherStatus()
{
return $this->Fields()->filter('Name', 'Weather Status')->first();
}
有什么方法可以显示 WeatherStatus 详细信息的“区域”模板。??
<% loop $findLatestReport %>
{$WeatherStatus}
<% end_loop %>
【问题讨论】:
标签: php silverstripe