Warning: You are browsing the documentation for PrestaShop 1.7, which is outdated.

You might want to read an updated version of this page for the current version, PrestaShop 8. Read the updated version of this page

Learn how to upgrade to the latest version.

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);