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


PHP CController::getModule方法代码示例

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


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

示例1: resolveBreadCrumbViewForDetailsControllerAction

 public static function resolveBreadCrumbViewForDetailsControllerAction(CController $controller, $stickySearchKey, RedBeanModel $model)
 {
     assert('is_string($stickySearchKey)');
     if (ArrayUtil::getArrayValue(GetUtil::getData(), 'stickyOffset') !== null && StickySearchUtil::getDataByKey($stickySearchKey) != null) {
         $stickyLoadUrl = Yii::app()->createUrl($controller->getModule()->getId() . '/' . $controller->getId() . '/renderStickyListBreadCrumbContent', array('stickyKey' => $stickySearchKey, 'stickyOffset' => ArrayUtil::getArrayValue(GetUtil::getData(), 'stickyOffset'), 'stickyModelId' => $model->id));
     } else {
         $stickyLoadUrl = null;
     }
     $className = static::resolveStickyDetailsAndRelationsBreadCrumbViewClassName();
     return new $className($controller->getId(), $controller->getModule()->getId(), static::resolveBreadcrumbLinks($model), $controller->getModule()->getModuleLabelByTypeAndLanguage('Plural'), $stickyLoadUrl);
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:11,代码来源:StickySearchUtil.php

示例2: renderList

 /**
  * @return rendered content from view as string.
  */
 public static function renderList(CController $controller, $dataProvider)
 {
     assert('$dataProvider instanceof RedBeanModelDataProvider');
     $auditEventsListView = new AuditEventsModalListView($controller->getId(), $controller->getModule()->getId(), 'AuditEvent', $dataProvider, 'modal');
     $view = new ModalView($controller, $auditEventsListView);
     return $view->render();
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:10,代码来源:AuditEventsListControllerUtil.php

示例3: renderList

 /**
  * @return rendered content from view as string.
  */
 public static function renderList(CController $controller, $dataProvider, $action)
 {
     assert('$dataProvider instanceof RedBeanModelDataProvider');
     $modalListLinkProvider = new UserDetailsModalListLinkProvider('users', 'default', 'details');
     $usersListView = new UsersByModelModalListView($controller->getId(), $controller->getModule()->getId(), $action, 'User', $modalListLinkProvider, $dataProvider, 'modal');
     $view = new ModalView($controller, $usersListView);
     return $view->render();
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:11,代码来源:UsersByModelModalListControllerUtil.php

示例4: renderModalSearchList

 /**
  * @return rendered content from view as string.
  */
 protected static function renderModalSearchList(CController $controller, $modalListLinkProvider, $stateMetadataAdapterClassName = null)
 {
     assert('$modalListLinkProvider instanceof ModalListLinkProvider');
     $className = $controller->getModule()->getPluralCamelCasedName() . 'ModalSearchAndListView';
     $modelClassName = $controller->getModule()->getPrimaryModelName();
     $searchViewClassName = $className::getSearchViewClassName();
     if ($searchViewClassName::getModelForMetadataClassName() != null) {
         $formModelClassName = $searchViewClassName::getModelForMetadataClassName();
         $model = new $modelClassName(false);
         $searchModel = new $formModelClassName($model);
     } else {
         throw new NotSupportedException();
     }
     $pageSize = Yii::app()->pagination->resolveActiveForCurrentUserByType('modalListPageSize', get_class($controller->getModule()));
     $dataProvider = $controller->makeRedBeanDataProviderByDataCollection($searchModel, $pageSize, $stateMetadataAdapterClassName);
     $searchAndListView = new $className($controller->getId(), $controller->getModule()->getId(), $controller->getAction()->getId(), $modalListLinkProvider, $searchModel, $model, $dataProvider, 'modal');
     $view = new ModalView($controller, $searchAndListView);
     return $view->render();
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:22,代码来源:ModalSearchListControllerUtil.php

示例5: makeHeaderView

 protected static function makeHeaderView(CController $controller)
 {
     $headerView = null;
     $settingsMenuItems = MenuUtil::getOrderedAccessibleHeaderMenuForCurrentUser();
     $settingsMenuItems = static::resolveHeaderMenuItemsForMobile($settingsMenuItems);
     $userMenuItems = static::getAndResolveUserMenuItemsForHeader();
     $applicationName = ZurmoConfigurationUtil::getByModuleName('ZurmoModule', 'applicationName');
     if (Yii::app()->userInterface->isMobile()) {
         $headerView = new MobileHeaderView($settingsMenuItems, $userMenuItems, $applicationName);
     } else {
         $shortcutsCreateMenuItems = MenuUtil::getAccessibleShortcutsCreateMenuByCurrentUser();
         $moduleNamesAndLabels = GlobalSearchUtil::getGlobalSearchScopingModuleNamesAndLabelsDataByUser(Yii::app()->user->userModel);
         $sourceUrl = Yii::app()->createUrl('zurmo/default/globalSearchAutoComplete');
         GlobalSearchUtil::resolveModuleNamesAndLabelsDataWithAllOption($moduleNamesAndLabels);
         $headerView = new HeaderView($controller->getId(), $controller->getModule()->getId(), $settingsMenuItems, $userMenuItems, $shortcutsCreateMenuItems, $moduleNamesAndLabels, $sourceUrl, $applicationName);
     }
     return $headerView;
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:18,代码来源:ZurmoDefaultViewUtil.php

示例6: renderModalMapView

 /**
  * Map modal view for map popup..
  * @return rendered content from view as string.
  */
 protected function renderModalMapView(CController $controller, $modalMapAddressData, $stateMetadataAdapterClassName = null)
 {
     $renderAndMapModalView = new AddressMapModalView($controller->getId(), $controller->getModule()->getId(), $modalMapAddressData, 'modal');
     $view = new ModalView($controller, $renderAndMapModalView);
     return $view->render();
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:10,代码来源:DefaultController.php

示例7: getLayoutFile

 /**
  * Finds the layout file for the specified controller's layout.
  * @param CController $controller the controller
  * @param string $layoutName the layout name
  * @return string the layout file path. False if the file does not exist.
  */
 public function getLayoutFile($controller, $layoutName)
 {
     $moduleViewPath = $basePath = $this->getViewPath();
     $module = $controller->getModule();
     if (empty($layoutName)) {
         while ($module !== null) {
             if ($module->layout === false) {
                 return false;
             }
             if (!empty($module->layout)) {
                 break;
             }
             $module = $module->getParentModule();
         }
         if ($module === null) {
             $layoutName = Yii::app()->layout;
         } else {
             $layoutName = $module->layout;
             $moduleViewPath .= '/' . $module->getId();
         }
     } else {
         if ($module !== null) {
             $moduleViewPath .= '/' . $module->getId();
         }
     }
     return $controller->resolveViewFile($layoutName, $moduleViewPath . '/layouts', $basePath, $moduleViewPath);
 }
开发者ID:juliocp88,项目名称:yii-example,代码行数:33,代码来源:CTheme.php

示例8: showCoin

 /**
  * Eventually refactor to support different randomness seeds on a per module basis, but until this is fleshed
  * out more, we will just hard-code the seeding here.
  */
 public static function showCoin(CController $controller)
 {
     //Reporting and Data cleanup actions should show coins more frequently
     if ($controller->getModule()->getId() == 'reports') {
         $value = mt_rand(1, 25);
     } else {
         $value = mt_rand(1, 50);
     }
     if ($value == 7) {
         return true;
     }
     return false;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:17,代码来源:GameCoin.php

示例9: makeTwoViewsWithBreadcrumbsForCurrentUser

 /**
  * Given a controller, two contained views, construct the gridview
  * used by the designer page view.
  * @param CController $controller
  * @param View $containedView
  * @param View $secondContainedView
  * @param array $breadCrumbLinks
  * @param $breadcrumbViewClassName
  * @param array $cssClasses
  * @return GridView
  */
 public static function makeTwoViewsWithBreadcrumbsForCurrentUser(CController $controller, View $containedView, View $secondContainedView, $breadCrumbLinks, $breadcrumbViewClassName, $cssClasses = array())
 {
     assert('is_array($breadCrumbLinks)');
     $gridView = new GridView(3, 1);
     $gridView->setCssClasses($cssClasses);
     $gridView->setView(new $breadcrumbViewClassName($controller->getId(), $controller->getModule()->getId(), $breadCrumbLinks), 0, 0);
     $gridView->setView($containedView, 1, 0);
     $gridView->setView($secondContainedView, 2, 0);
     return static::makeStandardViewForCurrentUser($controller, $gridView);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:21,代码来源:ZurmoDefaultViewUtil.php

示例10: getActionInstances

 /**
  * Gets the action instances for the given controller
  * @param \CController $controller the controller to get actions for
  *
  * @return \CAction[] the controller actions
  */
 public function getActionInstances(\CController $controller)
 {
     $controllerId = $controller->getId();
     $module = $controller->getModule();
     if (!is_object($module)) {
         $module = \Yii::app();
     }
     $uniqueId = $this->getModuleUniqueId($module);
     if (!isset($this->_data[$uniqueId])) {
         $this->_data[$uniqueId] = array();
     }
     if (!isset($this->_data[$uniqueId]['controllers'])) {
         $this->getControllerInstances($module);
     }
     if (!isset($this->_data[$uniqueId]['controllers'][$controllerId]['actions'])) {
         $this->_data[$uniqueId]['controllers'][$controllerId]['actions'] = $this->createActionInstances($controller);
     }
     return $this->_data[$uniqueId]['controllers'][$controllerId]['actions'];
 }
开发者ID:codemix,项目名称:restyii,代码行数:25,代码来源:Schema.php


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