zend_tag_cloud-设置选项
-
13-09-2019 - |
题
如何在zend_tag_cloud上设置MinFontSize属性?目前看起来像是这样,但是我有一个错误:
装饰器不是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
)
)
)
);
不隶属于 StackOverflow