<?php

class Zend_View_Helper_FlagLinks extends Zend_View_Helper_Abstract {

  
  public function flagLinks($languages, $availables = array(), $url = ''){
    // html output
    $html = "";
    foreach($languages as $l){
      // flag img
      $img = $l->getFlag(in_array($l->id, $availables));
      // add the link
      $html .= "<a href='{$url}language/{$l->id}' class='flag_link'><img src='{$img}'></a>";
    }
    return $html;
  }

}