Notice: You are browsing the documentation for PrestaShop 9, which is currently in development.
You might want to read the documentation for the current version, PrestaShop 8. Read the current version of this page
This column is used to display an image from a row. You need to specify which field of the row contains the image source.
Properties | Type | Expected value |
---|---|---|
src_field | string | required Indicates which field of the row contains the image source |
<?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);