Notice: You are browsing the documentation for PrestaShop 8, which is currently in development.

You might want to read the documentation for the current version, PrestaShop 1.7.

ImageColumn Type

This column is used to display an image from a row. You need to specify which field of the row contains the image source.

Available options

Properties Type Expected value
src_field string required Indicates which field of the row contains the image source

Example usage

<?php
use PrestaShop\PrestaShop\Core\Grid\Column\Type\Common\ImageColumn;
use PrestaShop\PrestaShop\Core\Grid\Column\ColumnCollection;

$imageColumn = new ImageColumn('flag');
$imageColumn->setName('Flag');
$imageColumn->setOptions([
     'src_field' => 'flag',
]);

$columns = new ColumnCollection();
$columns->add($imageColumn);