I now have my module working like I need it to and my single tag pair calls the correct function. But I'm wanting to create a tag pair that is common in most modules/plugins. Here is the function I am calling:
function get_photos()
{
$albums = unserialize( $this->get_setting_value( 'facebook_albums' ) );
$limit = intval( $this->EE->TMPL->fetch_param('limit') );
if( is_null( $limit ) || empty( $limit ) )
{
$limit = 50;
}
$layout = '';
$i = 0;
foreach( $albums as $album )
{
$photo_data = $this->get_facebook_graph_data( $album, 'photos' );
foreach( $photo_data->data as $photo ) {
if( $i === $limit )
{
break;
}
else {
$layout .= sprintf( '<img src="%s" alt="%s" rel="" />', $photo->images[5]->source, @$photo->name );
}
$i++;
}
}
return $layout;
}
I would like my tag pair to look like this:
{exp:fbphotos:get_photos}
<img src="{source}" alt="{name} />
{/exp:fbphotos}
I'm not looking for someone to write all of the code, just a way to map the tags to values and create the loop. Thanks!