Show ImageArray on View folder

Hello @Nadar, I’am new learning luya, I tried show in frontend , ( controlerr already done ) but ,I done have clue in View folder for ImageArray
public function ngRestAttributeTypes()
return [
‘asal_penindakan_fk’ =>
[‘selectModel’, ‘modelClass’ => AsalPenindakan::className(), ‘valueField’ => ‘id’, ‘labelField’ => ‘name’],
‘lokasi’ => ‘text’,
‘jenis_kasus_fk’ =>
[‘selectModel’, ‘modelClass’ => JenisKasus::className(), ‘valueField’ => ‘id’, ‘labelField’ => ‘name’],

        'foto' => 'imageArray' // have 3 picture

class DefaultController extends \luya\web\Controller {

public function actionIndex()
    // change the title of the page

    $dataindaks = Dataindak::find()
     ->andWhere(['is_publish' => '1'])->orderBy(['id' => SORT_DESC])->all();

    // var_dump($models1->'lokasi'); die;
    //var_dump($models1->; die;


    // render your file
    return $this->render('index', [
        'dataindaks' => $dataindaks,

=================== default/index=======

<?php foreach ($dataindaks as $model): ?>
        <td><?= $model->id ?></td>
        <td><?= $model->asal_penindakan_fk ?></td>
        <td><?= $model->lokasi ?></td>
        <td><?= $model->jenis_kasus_fk ?></td>
<?php endforeach; ?> =============================================== ![luya|690x388](upload://bqW94SKlvRUgqN4Ixrzom87uEmo.png) ![luya|690x388](upload://1TSAdpiUORdwBaxUSR5xRZzLaRC.gif)
# Asal Penindakan Lokasi Jenis Kasus

Hi @anhardeni

When you cast a field as imageArray you can directly set the property imageIterator to true, then you can just foreach the field and recieve an image item object from the storage system.

Build any web thing! — LUYA See the image Array Plugin for imageIterator details.

So in your case i assume it would be:

foreach ($model->foto as $imageItem) {
 echo $imageItem->source

Does that answer your question?

already add at models

‘foto’ => [‘imageArray’, ‘imageIterator’ => true],

at default /index.php

<?php foreach ($model->foto as $imageItem){
echo $imageItem->Yii::getAlias(’@public_html’.’/storage/’.$imageItem);

PHP Notice – yii\base\ErrorException

Trying to get property ‘Yii’ of non-object

$imageItem is an image item object when setting imageIterator to true. So you can just do:

<?php foreach ($model->foto as $imageItem): ?>
    <img src="<?= $imageItem->source; ?>" />
<?php endforeach; ?>

Thanks A lot @nadar , done