Question

Comment pourrais-je définir la propriété minFontSize sur Zend_Tag_Cloud? Il ressemble à ça pour le moment, mais je reçois une erreur:

  

Decorator est pas instance de Zend_Tag_Cloud_Decorator_Cloud

     $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;
Était-ce utile?

La solution

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
            )
        )
    )
);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top