当前位置: 首页>>代码示例>>PHP>>正文


PHP K2HelperRoute::getSearchRoute方法代码示例

本文整理汇总了PHP中K2HelperRoute::getSearchRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP K2HelperRoute::getSearchRoute方法的具体用法?PHP K2HelperRoute::getSearchRoute怎么用?PHP K2HelperRoute::getSearchRoute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在K2HelperRoute的用法示例。


在下文中一共展示了K2HelperRoute::getSearchRoute方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getSearch

 public static function getSearch($params)
 {
     $application = JFactory::getApplication();
     $search = new stdClass();
     $search->action = JRoute::_(K2HelperRoute::getSearchRoute());
     $search->text = $params->get('text', JText::_('K2_SEARCH'));
     $search->width = intval($params->get('width', 20));
     $search->maxLength = $search->width > 20 ? $search->width : 20;
     $search->button = $params->get('button');
     $search->buttonText = htmlspecialchars($params->get('button_text', JText::_('K2_SEARCH')));
     $search->imageButton = $params->get('imagebutton');
     $search->buttonPosition = $params->get('button_pos', 'left');
     $search->sef = $application->getCfg('sef');
     $search->filter = '';
     $filter = $params->get('category_id');
     if ($filter && isset($filter->enabled) && $filter->enabled) {
         $model = K2Model::getInstance('Categories');
         $categories = K2ModelCategories::getCategoryFilter($filter->categories, $filter->recursive, true);
         $search->filter = implode(',', $categories);
     }
     if ($params->get('liveSearch')) {
         $document = JFactory::getDocument();
         if ($document->getType() == 'html') {
             $document->addScript(JURI::root(true) . '/media/k2app/vendor/underscore/underscore-min.js?v=3.0.0');
             $document->addScriptDeclaration('var K2Site = "' . JURI::root(true) . '";');
         }
     }
     return $search;
 }
开发者ID:Naldo100,项目名称:k2-v3-dev-build,代码行数:29,代码来源:helper.php

示例2: defined

 */
// no direct access
defined('_JEXEC') or die;
?>

<?php 
$labels = explode(',', $field->get('value'));
?>

<?php 
if (is_array($labels)) {
    ?>
	<?php 
    foreach ($labels as $label) {
        ?>
		<?php 
        if ($label = trim($label)) {
            ?>
		<a href="<?php 
            echo JRoute::_(K2HelperRoute::getSearchRoute() . '&searchword=' . urlencode($label)) . '">' . $label;
            ?>
</a>
		<?php 
        }
        ?>
	<?php 
    }
}
?>

开发者ID:Naldo100,项目名称:k2-v3-dev-build,代码行数:29,代码来源:output.php

示例3:

        require JModuleHelper::getLayoutPath('mod_k2_tools', 'calendar');
        break;
    case '3':
        $breadcrumbs = modK2ToolsHelper::breadcrumbs($params);
        $path = $breadcrumbs[0];
        $title = $breadcrumbs[1];
        require JModuleHelper::getLayoutPath('mod_k2_tools', 'breadcrumbs');
        break;
    case '4':
        $output = modK2ToolsHelper::treerecurse($params, 0, 0, true);
        require JModuleHelper::getLayoutPath('mod_k2_tools', 'categories');
        break;
    case '5':
        echo modK2ToolsHelper::treeselectbox($params);
        break;
    case '6':
        $categoryFilter = modK2ToolsHelper::getSearchCategoryFilter($params);
        $action = JRoute::_(K2HelperRoute::getSearchRoute());
        require JModuleHelper::getLayoutPath('mod_k2_tools', 'search');
        break;
    case '7':
        $tags = modK2ToolsHelper::tagCloud($params);
        if (count($tags)) {
            require JModuleHelper::getLayoutPath('mod_k2_tools', 'tags');
        }
        break;
    case '8':
        $customcode = modK2ToolsHelper::renderCustomCode($params);
        require JModuleHelper::getLayoutPath('mod_k2_tools', 'customcode');
        break;
}
开发者ID:Tommar,项目名称:remate,代码行数:31,代码来源:mod_k2_tools.php

示例4: getSearchItems

 protected function getSearchItems($count = false)
 {
     // Get application
     $application = JFactory::getApplication();
     // Get input
     $search = trim($application->input->get('searchword', '', 'string'));
     // Determine offset and limit based on document type
     if ($this->type == 'html' || $this->type == 'raw') {
         $this->limit = $application->input->get('limit', 10, 'int');
     } else {
         $this->limit = $this->params->get('feedLimit', 10, 'int');
     }
     // Get items
     if ($search) {
         $model = K2Model::getInstance('Items');
         $model->setState('site', true);
         $model->setState('search', $search);
         $model->setState('limit', $this->limit);
         $model->setState('limitstart', $this->offset);
         $this->items = $model->getRows();
         // Count items
         if ($count) {
             $this->total = $model->countRows();
         }
     } else {
         $this->items = array();
         $this->total = 0;
     }
     // Form action
     $this->action = JRoute::_(K2HelperRoute::getSearchRoute());
     // Search word
     $this->searchword = $search;
 }
开发者ID:Naldo100,项目名称:k2-v3-dev-build,代码行数:33,代码来源:view.php


注:本文中的K2HelperRoute::getSearchRoute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。