本文整理汇总了PHP中PluginManager::getPluginTags方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginManager::getPluginTags方法的具体用法?PHP PluginManager::getPluginTags怎么用?PHP PluginManager::getPluginTags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginManager
的用法示例。
在下文中一共展示了PluginManager::getPluginTags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getArray
function getArray($pSearch)
{
$pSearch = trim($pSearch);
$array;
$pluginManager = new PluginManager();
$pluginArray = json_decode($pluginManager->getPlugins());
$pluginArray = $pluginManager->getPluginTags();
foreach ($pluginArray as $plugin) {
$name = $plugin['name'];
if (!empty($plugin['icon'])) {
$icon = $plugin['icon'];
} else {
$icon = 'images/th-small.png';
}
$id = $plugin['id'];
if ($this->isIn($pSearch, $name)) {
$array[] = array("title" => $name, "icon" => $icon, "click" => "openPlugin('{$id}','','')");
}
if (!empty($plugin['tags'])) {
$tags = $plugin['tags'];
foreach ($tags as $tag) {
if (is_array($tag) && count($tag) == 2 && count($tag[1]) == 2) {
if ($this->isIn($pSearch, $tag[0])) {
$description = $name . ' - ' . $tag[0];
$array[] = array("title" => $description, "icon" => $icon, "click" => "openPlugin('{$id}','" . $tag[1][0] . "','" . $tag[1][1] . "')");
}
} else {
if ($this->isIn($pSearch, $tag)) {
$description = $name . ' - ' . $tag;
$array[] = array("title" => $description, "icon" => $icon, "click" => "openPlugin('{$id}','','')");
}
}
}
}
}
if (!empty($array)) {
return $array;
}
return null;
}