gamitg/yii2-detailview4cols

This extension is a variation of the DetailView widget of Yii2. It has simply the same code with a few modification to it.

Installs: 2 510

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 1

Type:yii2-extension

v1.0.0 2015-08-24 16:07 UTC

This package is not auto-updated.

Last update: 2024-04-13 15:12:08 UTC


README

This extension is a variation of the DetailView widget of Yii2. It has simply the same code with a few modification to it. Thanks to "Yii 1.1: detailview4col (Developed by: c@cba) extension".

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist gamitg/yii2-detailview4cols "*"

or add

"gamitg/yii2-detailview4cols": "*"

to the require section of your composer.json file.

Note

If you getting error while installing this extension, so just add following line in your composer.json file.

"minimum-stability": "dev",
"prefer-stable": true,

Because of this extension currently available only in dev-master. So, i appreciate your suggestion and also issue fixing related to this extension.

Usage

Once the extension is installed, simply use it in your code by :

<?= \gamitg\detailview4cols\DetailView4Col::widget(); ?>

Example

	<?= \gamitg\detailview4cols\DetailView4Col::widget([
		        'model' => $model,
		        'options'=>['class'=>'table table-striped table-bordered detail-view'],
		        'attributes' => [
					'id',
					[
		        		'attribute' => 'user_id',
		        		'value' => $model->user->user_name,
		        		'oneRow' =>true
					],
			        'page.page_no',
			        'comment:ntext',
			        'time:datetime',
			        [
					   	'attribute'=>'created_by',
						'value'=>(!empty($model->user_id) ? $model->user_id : "Not Set")
				    ],
		        ],
    	]) ?>