Domanda

Come potrei impostare la proprietà minFontSize su Zend_Tag_Cloud? Sembra che al momento, ma ottengo un errore:

  

Decorator è alcuna istanza di 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;
È stato utile?

Soluzione

Provare qualcosa di simile a questo:

 $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
            )
        )
    )
);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top