Zend_Tag_Cloud - 设置选项
问题描述:
如何在Zend_Tag_Cloud上设置minFontSize属性? 它看起来像此刻,但是我得到一个错误:Zend_Tag_Cloud - 设置选项
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;
答
尝试是这样的:
$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
)
)
)
);