當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JInput::getWord方法代碼示例

本文整理匯總了PHP中JInput::getWord方法的典型用法代碼示例。如果您正苦於以下問題:PHP JInput::getWord方法的具體用法?PHP JInput::getWord怎麽用?PHP JInput::getWord使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JInput的用法示例。


在下文中一共展示了JInput::getWord方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 /**
  * Init this component.
  *
  * @return void
  */
 public function init()
 {
     $dispatcher = $this->container->get('event.dispatcher');
     // Event
     $dispatcher->trigger('onComponentBeforeInit', array($this->name, $this, $this->input));
     // We build component path constant, helpe us get path easily.
     $this->path['self'] = JPATH_BASE . '/components/' . strtolower($this->option);
     $this->path['site'] = JPATH_ROOT . '/components/' . strtolower($this->option);
     $this->path['administrator'] = JPATH_ROOT . '/administrator/components/' . strtolower($this->option);
     define(strtoupper($this->name) . '_SELF', $this->path['self']);
     define(strtoupper($this->name) . '_SITE', $this->path['site']);
     define(strtoupper($this->name) . '_ADMIN', $this->path['administrator']);
     // Register some useful object for this component.
     $this->container->registerServiceProvider(new ComponentProvider($this->name, $this));
     $task = $this->input->getWord('task');
     $controller = $this->input->getWord('controller');
     // Prepare default controller
     if (!$task && !$controller) {
         // If we got view, set it to display controller.
         $view = $this->input->get('view');
         $task = $view ? $view . '.display' : $this->defaultController;
         $this->input->set('task', $task);
         $this->input->set('controller', $task);
     }
     // Register form and fields
     \JForm::addFieldPath(WINDWALKER_SOURCE . '/Form/Fields');
     \JForm::addFormPath(WINDWALKER_SOURCE . '/Form/Forms');
     $this->registerEventListener();
     // Register elFinder controllers
     // @TODO: Should use event listener
     $this->registerTask('finder.elfinder.display', '\\Windwalker\\Elfinder\\Controller\\DisplayController');
     $this->registerTask('finder.elfinder.connect', '\\Windwalker\\Elfinder\\Controller\\ConnectController');
     // Event
     $dispatcher->trigger('onComponentAfterInit', array($this->name, $this, $this->input));
 }
開發者ID:beingsane,項目名稱:quickcontent,代碼行數:40,代碼來源:Component.php

示例2: generateBodyClass

 public function generateBodyClass()
 {
     $url = new JInput();
     $itemid = $url->getVar('Itemid');
     $menu = @$this->app->getMenu();
     $active = @$menu->getActive();
     $params = @$menu->getParams($active->id);
     $class = NULL;
     $class .= $this->get('style') == '-1' ? 'style-none' : $this->get('style');
     $class .= ' align-' . $this->direction;
     $class .= ' page-id-' . (isset($active) ? $active->id : $menu->getDefault()->id);
     //Add class of homepage if it's home
     if ($menu->getActive() == $menu->getDefault()) {
         $class .= ' homepage ';
     } else {
         $view = $url->getWord('view');
         $component = str_replace('_', '-', $url->getCmd('option'));
         $class .= ' ' . $component . '-' . $view;
     }
     $class .= ' ' . strtolower($this->browser->getBrowser());
     $class .= $this->displayComponent() ? '' : ' com-disabled';
     $class .= ' ' . $params->get('pageclass_sfx');
     return 'class="' . $class . '"';
 }
開發者ID:pguilford,項目名稱:vcomcc,代碼行數:24,代碼來源:core.php


注:本文中的JInput::getWord方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。