如何在Zend_Tag_Cloud上设置minFontSize属性? 目前看起来像是这样,但我收到了一个错误:
Decorator不是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;
答案 0 :(得分:2)
尝试这样的事情:
$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
)
)
)
);