2009-12-06 7 views
0

Comment définir la propriété minFontSize sur Zend_Tag_Cloud? On dirait que pour le moment, mais je reçois une erreur:Zend_Tag_Cloud - Définir les options

Decorator is no instance of Zend_Tag_Cloud_Decorator_Tag

 $cloud = new Zend_Tag_Cloud(
     array(
      'tags' => array(
       array('title' => 'Code', 'weight' => 50), 
       array('title' => 'Zend Framework', 'weight' => 100), 
       array('title' => 'PHP', 'weight' => 25) 
      ) 
     ) 
    ); 
    $cloud->setTagDecorator(array('minFontSize' => 20)); 

    echo $cloud; 

Répondre

2

Essayez quelque chose comme ceci:

$cloud = new Zend_Tag_Cloud(
    array(
     'tags' => array(
      array('title' => 'Code', 'weight' => 50), 
      array('title' => 'Zend Framework', 'weight' => 100), 
      array('title' => 'PHP', 'weight' => 25) 
     ), 
     'tagDecorator' => array(
      'decorator' => 'HtmlTag', 
      'options' => array(
       'htmlTags' => array(), 
       'fontSizeUnit' => 'px', 
       'minFontSize' => 20 
      ) 
     ) 
    ) 
); 
Questions connexes