本文整理汇总了PHP中ActionResponse::getData方法的典型用法代码示例。如果您正苦于以下问题:PHP ActionResponse::getData方法的具体用法?PHP ActionResponse::getData怎么用?PHP ActionResponse::getData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionResponse
的用法示例。
在下文中一共展示了ActionResponse::getData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setGridResponse
protected function setGridResponse(ActionResponse $response = null)
{
if (empty($response)) {
$jsonResponse = true;
$response = new ActionResponse();
}
$displayedColumns = $this->getRequestColumns();
$availableColumns = $this->getAvailableRequestColumns();
// sort available columns by display state (displayed columns first)
$displayedAvailable = array_intersect_key($availableColumns, $displayedColumns);
$notDisplayedAvailable = array_diff_key($availableColumns, $displayedColumns);
$availableColumns = array_merge($displayedAvailable, $notDisplayedAvailable);
$response->set('displayedColumns', $displayedColumns);
$response->set('availableColumns', $availableColumns);
$response->set('advancedSearchColumns', $this->getAdvancedSearchFields());
$response->set('columnWidths', $this->user->getPreference('columnWidth_' . get_class($this)));
$response->set('massForm', $this->getMassForm());
$response->set('offset', $this->request->get('offset'));
$response->set('totalCount', '0');
$response->set('filters', $this->request->get('filters'));
$response->set('data', $this->lists(false, $displayedColumns)->getData());
if (isset($jsonResponse)) {
return $response->getData();
}
return $response;
}