Jui Autocomplete Data Format

Controller:

$products = ArrayHelper::map(Products::find()->all(), ‘id’, ‘name’);

I have taken my products list as array using the above code which outputs

Array

(

[1] => shirt


[2] => pant


[3] => t-shirt


[4] => sample

)

and in my view i have passed the array to Jui Autocomplete widget as

<?= AutoComplete::widget([

'model' =&gt; &#036;products,


'attribute' =&gt; 'products',


'clientOptions' =&gt; [


    'source' =&gt; &#036;products,


],

]); ?>

which it results in jquery as

jQuery(’#w1’).autocomplete({“source”:[{“1”:“shirt”,“2”:“pant”,“3”:“t-shirt”,“4”:“sample”}]});

but my autocomplete doesn’t populates the result.

What I’m lacking in please advise. Thanks in advance.