<?php
$myarray = array();
<script type="text/javascript">
$(function(){
$("#demo").grid({
'genre' : 'All',
'items' :
[
{
'title' : 'A',
'description' : 'qwerty',
'thumbnail' : ['http://mypd.front.net/f4534.jpg'],
'large' : ['http://mypd.front.net/f4534_large.jpg'],
'button_list' :
[
{ 'title':'Demo', 'url' : 'http://mypd.front.net/', 'new_window' : true }
],
'tags' : ['Movies']
},
{
'title' : 'B',
'description' : 'asdfg',
'thumbnail' : ['http://mypd.front.net/f5534.jpg'],
'large' : ['http://mypd.front.net/f5534_large.jpg'],
'button_list' :
[
{ 'title':'Demo', 'url' : 'http://mypd.front.net/', 'new_window' : true }
],
'tags' : ['Series']
},
...
...
...
{
'title' : 'Z',
'description' : 'poiyut',
'thumbnail' : ['http://mypd.front.net/f6534.jpg'],
'large' : ['http://mypd.front.net/f6534_large.jpg'],
'button_list' :
[
{ 'title':'Demo', 'url' : 'http://mypd.front.net/', 'new_window' : true }
],
'tags' : ['Movies', 'Series']
}
]
});
});
</script>
This an embedded script in my legacy index.php.
Now what I wanted to do is to populate the data inside the array of items(like title, description, etc.) by reading it from an array which I have in the php file.
Could you please let me know how I can do this?
Something like this is what I am looking for?
for ($i = 0; $i < sizeof($vodAssetArray); $i++)
{
populate each of the items in the java script like
{
'title' : $vodAssetArray[i]->title,
'description' : $vodAssetArray[i]->description,
'thumbnail' : [$vodAssetArray[i]->imgSrc],
'large' : [$vodAssetArray[i]->imgSrc],
'button_list' :
[
{ 'title':'Demo', 'url' : 'http://mypd.front.net/', 'new_window' : true }
],
'tags' : [$vodAssetArray[i]->genre]
},
}
?>