Frage

Wie könnte ich die minfontsize -Eigenschaft auf Zend_Tag_cloud einstellen? Es sieht im Moment so aus, aber ich bekomme einen Fehler:

Dekorateur ist keine Instanz von 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;
War es hilfreich?

Lösung

Probieren Sie so etwas aus:

 $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
            )
        )
    )
);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top