image-column a Column for CGridView that can display a image, with a optional link

  1. Installation
  2. Example Usage

This column assumes that the filename is saved as a path to the image that is to be rendered. If no pathPrefix is given, it assumes Yii::app()->baseUrl as a prefix for the image.

Installation

extract the file to your application components/ directory.

Example Usage

Yii::import('application.components.EImageColumn');
  $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'photo-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'id',
		array(
			'class'=>'EImageColumn',
			'name' => 'filename',
			'htmlOptions' => array('style' => 'width: 150px;'),
			),
		'album.title',
		'album.category.title',
		'title',
		'filename',
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>


4 0
16 followers
2 011 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: User Interface
Developed by: thyseus
Created on: May 22, 2011
Last updated: 13 years ago

Downloads

show all

Related Extensions