继承 | yii\widgets\BaseListView » yii\base\Widget » yii\base\Component » yii\base\Object |
---|---|
可用自版本 | 2.0 |
BaseListView是一个基类等小部件显示数据从数据提供者列表视图,显示数据表格。
它提供的功能,如排序、分页和过滤数据。
在BaseListView更多细节和使用信息,请参阅指南文章数据窗口小部件。
公共属性
属性 | 类型 | 描述 | 定义在 |
---|---|---|---|
$dataProvider | yii\data\DataProviderInterface | 的数据提供者视图。 | yii\widgets\BaseListView |
$emptyText | string | 要显示的HTML内容,当$dataProvider没有任何数据。 | yii\widgets\BaseListView |
$emptyTextOptions | array | 列表的HTML属性emptyText视图。 | yii\widgets\BaseListView |
$layout | string | 布局决定列表视图的不同地区应该如何组织 | yii\widgets\BaseListView |
$options | array | HTML属性的容器标签列表视图。 | yii\widgets\BaseListView |
$pager | array | 寻呼机的配置小部件。 | yii\widgets\BaseListView |
$showOnEmpty | boolean | 是否显示一个空的列表视图如果$ dataProvider没有返回任何数据。 | yii\widgets\BaseListView |
$sorter | array | 分选机的配置小部件。 | yii\widgets\BaseListView |
$summary | string | 要显示的HTML内容的汇总列表视图。 | yii\widgets\BaseListView |
$summaryOptions | array | HTML属性列表视图的摘要。 | yii\widgets\BaseListView |
公共方法
方法 | 描述 | 定义在 |
---|---|---|
init() | 初始化视图。 | yii\widgets\BaseListView |
renderEmpty() | 呈现的HTML内容,表明列表视图没有数据。 | yii\widgets\BaseListView |
renderItems() | 呈现的数据模型。 | yii\widgets\BaseListView |
renderPager() | 呈现寻呼机 | yii\widgets\BaseListView |
renderSection() | 呈现一段指定的名称。 | yii\widgets\BaseListView |
renderSorter() | 使分类器。 | yii\widgets\BaseListView |
renderSummary() | 呈现摘要文本。 | yii\widgets\BaseListView |
run() | 的小部件。 | yii\widgets\BaseListView |
属性详情
$dataProvider public property
的数据提供者视图。这个属性是必需的
public yii\data\DataProviderInterface $dataProvider = null
$emptyText public property
HTML内容是如何当$dataProvider不会有任何日期。
public string $emptyText = null
$emptyTextOptions public property
列表的HTML属性emptyText视图。“标签”元素指定的标签名称emptyText元素和默认为" div "。
参见 yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public array $emptyTextOptions = ['class' => 'empty']
$layout public property
布局决定列表视图的不同地区应该如何组织。下面的标记将被替换为相应的部分内容:
{summary}
: the summary section. See renderSummary().{items}
: the list items. See renderItems().{sorter}
: the sorter. See renderSorter().{pager}
: the pager. See renderPager().
public string $layout = "{summary}\n{items}\n{pager}"
$options public property
HTML属性的容器标签列表视图。“标签”元素指定的容器元素标签名称和默认为" div ".
参见 yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
$pager public property
寻呼机的配置小部件。默认情况下, yii\widgets\LinkPager将用于呈现寻呼机。您可以使用一个不同的小部件类通过配置“类”的元素。注意,小部件必须支持分页属性将数据填充yii\data\BaseDataProvider::pagination $dataProvider的价值。
$showOnEmpty public property
是否显示一个空的列表视图如果$ dataProvider没有返回任何数据。默认值是错误的显示一个元素根据emptyText和emptyTextOptions属性。
public boolean $showOnEmpty = false
$sorter public property
分选机的配置小部件。默认情况下,yii\widgets\LinkSorter将用于呈现分选机。您可以使用一个不同的小部件类通过配置“类”的元素。注意小部件必须支持的属性将数据填充 yii\data\BaseDataProvider::sort $dataProvider.的价值。
$summary public property
要显示的HTML内容的汇总列表视图。如果你不想显示摘要,您可以设置一个空字符串。
下面的标记将被替换为相应的值:
{begin}
: 起始行号(基于)正在显示出来{end}
: 结束行号(基于)正在显示出来{count}
: 当前显示的行数{totalCount}
:可用的总行数{page}
: 当前显示的页码(基于){pageCount}
:可用的页面数量
$summaryOptions public property
HTML属性列表视图的摘要。“标签”元素指定summary元素的标记名和默认为" div "。
参见 yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public array $summaryOptions = ['class' => 'summary']
方法详情
init() public 方法
Initializes the view.
public void init ( ) |
renderEmpty() public 方法
呈现的 HTML 内容,该值指示列表视图中没有任何数据。
参见 $emptyText.
public string renderEmpty ( ) | ||
return | string | 呈现的结果 |
---|
renderItems() public abstract 方法
呈现的数据模型。
public abstract string renderItems ( ) | ||
return | string | 呈现的结果 |
---|
renderPager() public 方法
呈现页导航
public string renderPager ( ) | ||
return | string | 呈现的结果 |
---|
renderSection() public 方法
呈现一段指定的名称。
如果不支持指定的部分,将返回false。
public string|boolean renderSection ( $name ) | ||
$name | string | 部分的名称,如, |
return | string|boolean | 的渲染结果部分,或假不支持如果指定的部分。 |
---|
renderSorter() public 方法
使分类器。
public string renderSorter ( ) | ||
return | string | 呈现的结果 |
---|
renderSummary() public 方法
呈现摘要文本。
public void renderSummary ( ) |
run() public 方法
的小部件。
public void run ( ) |