An extended Yii2 DetailView with many additional features. Extends the Yii DetailView to support multi columnar rows and work in both VIEW and EDIT modes. Accelerates your development by using a single configuration of attributes for both VIEW and EDIT. The extension also includes easier methods to style your detail view widget cells, data, form inputs, widgets, and columns (more specifically for Bootstrap 3). The widget by default can be styled within a Bootstrap 3 panel with a buttons toolbar to toggle modes and control your data. Refer detailed documentation and/or a complete demo.
Refer the CHANGE LOG for details of changes to various releases.
NOTE: Bootstrap 5.x support is added since v1.8.4. The extension includes a BC Breaking change with v1.7.0. With this release, the
template
property of the yii core DetailView is not anymore supported. One can userowOptions
,labelColOptions
,valueColOptions
at the widget level or widgetattributes
level to configure advanced layout functionality.
You can see detailed documentation, demonstration and API code documentation on usage of the extension.
The preferred way to install this extension is through composer.
Note: Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the
minimum-stability
settings for your application's composer.json.
Either run
$ php composer.phar require kartik-v/yii2-detail-view "@dev"
or add
"kartik-v/yii2-detail-view": "@dev"
to the require
section of your composer.json
file.
use kartik\detail\DetailView;
echo DetailView::widget([
'model'=>$model,
'condensed'=>true,
'hover'=>true,
'mode'=>DetailView::MODE_VIEW,
'panel'=>[
'heading'=>'Book # ' . $model->id,
'type'=>DetailView::TYPE_INFO,
],
'attributes'=>[
'code',
'name',
['attribute'=>'publish_date', 'type'=>DetailView::INPUT_DATE],
]
]);
yii2-detail-view is released under the BSD-3-Clause License. See the bundled LICENSE.md
for details.
yii2-detail-view
Date: 04-Mar-2022
Date: 11-Jan-2022
DetailView::childTableOptions
.arrayValueToString
to control array values being printed via print_r
.showErrorSummary
in docs.Date: 03-Sep-2021
Date: 01-Sep-2021
Date: 15-May-2020
Date: 10-Oct-2018
Date: 27-Sep-2018
BootstrapTrait::getCssClass
.Date: 27-Sep-2018
Date: 26-Sep-2018
Date: 23-Sep-2018
kartik\base\BootstrapInterface
.Date: 11-Sep-2018
src
directory.Date: 04-May-2017
hashVarLoadPosition
property.errorSummary
in error flash.INPUT_DROPDOWN_LIST
constant definition.{buttons}
token in mainTemplate
.panelOptions
and panelCssPrefix
to custom style the bootstrap panel.Date: 22-Jun-2016
['fieldConfig']['template']
.form
instance and custom markup in edit mode.dev-master
updates.hasErrors
check.StarRating
repo.Date: 11-Jan-2016
table-condensed
.Date: 13-Sep-2015
enableEditMode = false
.rowOptions
and hideIfEmpty
.visible
attribute setting.Date: 23-Aug-2015
hideAlerts
property to control display of alerts.viewModel
and editModel
properties at attributes level for each attribute
which will override the model
property at the widget level.Date: 22-May-2015
headingOptions
and footerOptions
.inputContainer
to control HTML options and ability to use bootstrap grid column classes.panel-body
above the DetailView.alertContainerOptions
: array, the HTML attributes for the alert block container which will display any alert messages received on update or delete of record. This will not be displayed if there are no alert messages.alertWidgetOptions
: array, the widget settings for each bootstrap alert displayed in the alert container block. The CSS class in options
within this will be auto derived and appended.
update
error messages will be displayed if you have set messages using Yii::$app->session->setFlash. The CSS class for the error block will be auto-derived based on flash message type using alertMessageSettings
.delete
this will be displayed based on the ajax response. The ajax response should be an object that contain the following:
alertMessageSettings
, and the value must be the message content to be displayed.alertMessageSettings
: The session flash or alert message type and its corresponding CSS class. Defaults to:
[
'kv-detail-error' => 'alert alert-danger',
'kv-detail-success' => 'alert alert-success',
'kv-detail-info' => 'alert alert-info',
'kv-detail-warning' => 'alert alert-warning'
]
deleteOptions
property takes in the following properties
url
label
params
: the parameters to pass to ajax based response as key value pairsconfirm
: confirmation alert messageajaxSettings
: the complete ajax configuration to override or append to if needed\kartik\base\WidgetTrait
to initialize krajee plugin.Date: 02-Mar-2015
panel['heading']
to be set as string or a boolean false
to disable it. This will display the panel title.panel['headingOptions']
which contains HTML attributes for panel heading title. Defaults to ['class'=>'panel-title']
. The following special options are recognized:
tag
: defaults to h3
template
: defaults to {buttons}{title}
where {title}
will be replaced with panel['heading']
and {buttons}
with the detail view action buttonspanel['footer']
to be set as string or a boolean false
to disable it. This will display the panel title.panel['footerOptions']
which contains HTML attributes for panel footer title. Defaults to ['class'=>'panel-title']
. The following special options are recognized:
tag
: defaults to h3
template
: defaults to {title}
where {title}
will be replaced with panel['footer']
{buttonContainer}
at widget level to set button toolbar options.NOTE: The extension includes a BC Breaking change with v1.7.0. With this release, the
template
property of the yii core DetailView is not anymore supported. One can userowOptions
,labelColOptions
,valueColOptions
at the widget level or widgetattributes
level to configure advanced layout functions.
- (enh #38): German translations updated.
- Set copyright year to current.
- (enh #37): Add bootstrap tooltips support for button titles.
- (enh #36): Ability to selectively hide rows in Edit mode or View mode.
- (enh #35): Add support for HIDDEN INPUT.
- (enh #34): Ability to configure rowOptions, labelColOptions, and valueColOptions at attribute level.
- (enh #33): Added ability to configure rowOptions.
- (enh #32): Added new reset button for use in edit mode.
- (enh #18): Ability to group attributes.
- (enh #17): Ability to hide rows with empty elements.
Date: 28-Jan-2015
Date: 12-Jan-2015
Date: 06-Dec-2014
\kartik\base\Config
.Date: 10-Nov-2014
Date: 19-Oct-2014
Date: 15-Jul-2014
Date: 15-May-2014
DetailView::INPUT_DATE_RANGE
or \kartik\widgets\DateRangePicker
DetailView::INPUT_SORTABLE
or \kartik\sortinput\SortableInput
static
variable references to self
(kartik-v)
Comments