diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index a6aec0a4e2..eb42d3e98f 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -178,6 +178,7 @@ Yii Framework 2 Change Log - Enh: LinkPager can now register relational link tags in the html header for prev, next, first and last page (cebe) - Enh: Added `yii\web\UrlRuleInterface` and `yii\web\CompositeUrlRule` (qiangxue) - Enh: Added `yii\web\Request::getAuthUser()` and `getAuthPassword()` (qiangxue) +- Enh: Added summaryOptions and emptyTextOptions to BaseListView (johonunu) - Chg #47: Changed Markdown library to cebe/markdown and adjusted Markdown helper API (cebe) - Chg #735: Added back `ActiveField::hiddenInput()` (qiangxue) - Chg #1186: Changed `Sort` to use comma to separate multiple sort fields and use negative sign to indicate descending sort (qiangxue) diff --git a/framework/widgets/BaseListView.php b/framework/widgets/BaseListView.php index e31f00377d..e26519a114 100644 --- a/framework/widgets/BaseListView.php +++ b/framework/widgets/BaseListView.php @@ -53,6 +53,12 @@ abstract class BaseListView extends Widget * - `{pageCount}`: the number of pages available */ public $summary; + /** + * @var array the HTML attributes for the summary of the list view. + * The "tag" element specifies the tag name of the summary element and defaults to "div". + * @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered. + */ + public $summaryOptions = ['class' => 'summary']; /** * @var boolean whether to show the list view if [[dataProvider]] returns no data. */ @@ -61,6 +67,12 @@ abstract class BaseListView extends Widget * @var string the HTML content to be displayed when [[dataProvider]] does not have any data. */ public $emptyText; + /** + * @var array the HTML attributes for the emptyText of the list view. + * The "tag" element specifies the tag name of the emptyText element and defaults to "div". + * @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered. + */ + public $emptyTextOptions = ['class' => 'empty']; /** * @var string the layout that determines how different sections of the list view should be organized. * The following tokens will be replaced with the corresponding section contents: @@ -139,7 +151,8 @@ abstract class BaseListView extends Widget */ public function renderEmpty() { - return '