本文整理汇总了PHP中Drupal\views\Tests\ViewTestBase::viewsData方法的典型用法代码示例。如果您正苦于以下问题:PHP ViewTestBase::viewsData方法的具体用法?PHP ViewTestBase::viewsData怎么用?PHP ViewTestBase::viewsData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\views\Tests\ViewTestBase
的用法示例。
在下文中一共展示了ViewTestBase::viewsData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: viewsData
/**
* {@inheritdoc}
*/
protected function viewsData()
{
$data = parent::viewsData();
// Override the name handler to be able to call placeholder() from outside.
$data['views_test_data']['name']['field']['id'] = 'test_field';
// Setup one field with an access callback and one with an access callback
// and arguments.
$data['views_test_data']['access_callback'] = $data['views_test_data']['id'];
$data['views_test_data']['access_callback_arguments'] = $data['views_test_data']['id'];
foreach (ViewExecutable::getHandlerTypes() as $type => $info) {
if (isset($data['views_test_data']['access_callback'][$type]['id'])) {
$data['views_test_data']['access_callback'][$type]['access callback'] = 'views_test_data_handler_test_access_callback';
$data['views_test_data']['access_callback_arguments'][$type]['access callback'] = 'views_test_data_handler_test_access_callback_argument';
$data['views_test_data']['access_callback_arguments'][$type]['access arguments'] = array(TRUE);
}
}
return $data;
}