public function frontendSidebar($params) { $output = array(); $config = (include $this->path . '/lib/config/config.php'); $tag_model = new blogTagPluginModel(); if ($tags = $tag_model->getAllTags($config)) { $output['sidebar'] = '<div class="tags cloud">'; $wa = wa(); foreach ($tags as $tag) { $tag['link'] = $wa->getRouteUrl('blog/frontend', array('tag' => urlencode($tag['name'])), true); $tag['name'] = htmlentities($tag['name'], ENT_QUOTES, 'utf-8'); $output['sidebar'] .= <<<HTML <a href="{$tag['link']}" style="font-size: {$tag['size']}%; opacity: {$tag['opacity']};">{$tag['name']}</a> HTML; } $output['sidebar'] .= '</div>'; } return ifempty($output, null); }
public function execute() { $config = (include wa()->getAppPath() . '/' . $this->getPluginRoot() . 'lib/config/config.php'); $tag_model = new blogTagPluginModel(); $this->view->assign('tags', $tag_model->getAllTags($config)); }