Zend_Tag_Cloud - Establecer las opciones
-
13-09-2019 - |
Pregunta
¿Cómo podría establecer la propiedad minFontSize en Zend_Tag_Cloud? Se ve como que por el momento, pero me da un error:
Decorador hay ninguna instancia de 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;
Solución
Trate algo como esto:
$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
)
)
)
);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow