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


PHP ConfigResolverInterface::hasParameter方法代码示例

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


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

示例1: getParameter

 /**
  * Returns the parameter value from config resolver.
  *
  * @param string $parameterName
  * @param string $namespace
  * @param mixed $defaultValue
  *
  * @return mixed
  */
 protected function getParameter($parameterName, $namespace, $defaultValue = null)
 {
     if ($this->configResolver->hasParameter($parameterName, $namespace)) {
         return $this->configResolver->getParameter($parameterName, $namespace);
     }
     return $defaultValue;
 }
开发者ID:netgen,项目名称:tagsbundle,代码行数:16,代码来源:CachedValue.php

示例2: getParameter

 public function getParameter($parameterName, $defaultValue = null)
 {
     if ($this->configResolver->hasParameter($parameterName)) {
         return $this->configResolver->getParameter($parameterName);
     }
     return $defaultValue;
 }
开发者ID:dfritschy,项目名称:ezpublish-kernel,代码行数:7,代码来源:CachedValue.php

示例3: yuiConfigLoaderFunction

 /**
  * Returns the YUI loader configuration.
  *
  * @param string $configObject
  *
  * @return string
  */
 public function yuiConfigLoaderFunction($configObject = '')
 {
     $modules = array_fill_keys($this->configResolver->getParameter('yui.modules', 'ez_platformui'), true);
     $yui = ['filter' => $this->configResolver->getParameter('yui.filter', 'ez_platformui'), 'modules' => []];
     $combine = $this->configResolver->getParameter('yui.combine', 'ez_platformui');
     if ($combine === true) {
         $yui['combine'] = true;
         $yui['root'] = '';
         $yui['comboBase'] = $this->router->generate('yui_combo_loader') . '?';
     }
     foreach (array_keys($modules) as $module) {
         if (!isset($yui['modules'][$module]['requires'])) {
             $yui['modules'][$module]['requires'] = [];
         }
         // Module dependencies
         if ($this->configResolver->hasParameter("yui.modules.{$module}.requires", 'ez_platformui')) {
             $yui['modules'][$module]['requires'] = array_merge($yui['modules'][$module]['requires'], $this->configResolver->getParameter("yui.modules.{$module}.requires", 'ez_platformui'));
         }
         // Reverse dependencies
         if ($this->configResolver->hasParameter("yui.modules.{$module}.dependencyOf", 'ez_platformui')) {
             foreach ($this->configResolver->getParameter("yui.modules.{$module}.dependencyOf", 'ez_platformui') as $dep) {
                 // Add reverse dependency only if referred module is declared in the modules list.
                 if (!isset($modules[$dep])) {
                     if ($this->logger) {
                         $this->logger->error("'{$module}' is declared to be a dependency of undeclared module '{$dep}'. Ignoring.");
                     }
                     continue;
                 }
                 $yui['modules'][$dep]['requires'][] = $module;
             }
         }
         if ($combine === true) {
             $yui['modules'][$module]['combine'] = true;
         }
         if ($this->configResolver->getParameter("yui.modules.{$module}.type", 'ez_platformui') === 'template') {
             $yui['modules'][$module]['requires'][] = 'template';
             $yui['modules'][$module]['requires'][] = 'handlebars';
             $yui['modules'][$module]['fullpath'] = $this->router->generate('template_yui_module', ['module' => $module]);
         } else {
             $yui['modules'][$module]['fullpath'] = $this->asset($this->configResolver->getParameter("yui.modules.{$module}.path", 'ez_platformui'));
         }
     }
     // Now ensure that all requirements are unique
     foreach ($yui['modules'] as &$moduleConfig) {
         $moduleConfig['requires'] = array_unique($moduleConfig['requires']);
     }
     $res = '';
     if ($configObject != '') {
         $res = $configObject . ' = ';
     }
     return $res . (defined('JSON_UNESCAPED_SLASHES') ? json_encode($yui, JSON_UNESCAPED_SLASHES) : json_encode($yui)) . ';';
 }
开发者ID:yed30,项目名称:PlatformUIBundle,代码行数:59,代码来源:TwigYuiExtension.php

示例4: getEmbedTemplateName

 /**
  * Returns configured template reference for the given embed parameters.
  *
  * @param $resourceType
  * @param $isInline
  * @param $isDenied
  *
  * @return null|string
  */
 protected function getEmbedTemplateName($resourceType, $isInline, $isDenied)
 {
     $configurationReference = $this->embedConfigurationNamespace;
     if ($resourceType === static::RESOURCE_TYPE_CONTENT) {
         $configurationReference .= '.content';
     } else {
         $configurationReference .= '.location';
     }
     if ($isInline) {
         $configurationReference .= '_inline';
     }
     if ($isDenied) {
         $configurationReference .= '_denied';
     }
     if ($this->configResolver->hasParameter($configurationReference)) {
         $configuration = $this->configResolver->getParameter($configurationReference);
         return $configuration['template'];
     }
     if (isset($this->logger)) {
         $this->logger->warning("Embed tag configuration '{$configurationReference}' was not found");
     }
     $configurationReference = $this->embedConfigurationNamespace;
     $configurationReference .= '.default';
     if ($isInline) {
         $configurationReference .= '_inline';
     }
     if ($this->configResolver->hasParameter($configurationReference)) {
         $configuration = $this->configResolver->getParameter($configurationReference);
         return $configuration['template'];
     }
     if (isset($this->logger)) {
         $this->logger->warning("Embed tag default configuration '{$configurationReference}' was not found");
     }
     return null;
 }
开发者ID:ezsystems,项目名称:ezpublish-kernel,代码行数:44,代码来源:Renderer.php

示例5: isLegacyModeSiteAccess

 /**
  * Returns if the provided siteaccess is running in legacy mode.
  *
  * @param string $siteAccessName
  *
  * @return bool
  */
 protected function isLegacyModeSiteAccess($siteAccessName)
 {
     if (!$this->configResolver->hasParameter('legacy_mode', 'ezsettings', $siteAccessName)) {
         return false;
     }
     return $this->configResolver->getParameter('legacy_mode', 'ezsettings', $siteAccessName);
 }
开发者ID:netgen,项目名称:ezplatform-site-api,代码行数:14,代码来源:PreviewController.php

示例6: configResolverGetParameter

 /**
  * Returns value for $paramName, in $namespace.
  *
  * @param string $paramName The parameter name, without $prefix and the current scope (i.e. siteaccess name).
  * @param string $namespace Namespace for the parameter name. If null, the default namespace should be used.
  * @param string $scope The scope you need $paramName value for.
  *
  * @return mixed
  */
 public function configResolverGetParameter($paramName, $namespace = 'ezsettings')
 {
     $scope = null;
     if ($this->configResolver->hasParameter($paramName, $namespace, $scope)) {
         return $this->configResolver->getParameter($paramName, $namespace, $scope);
     } else {
         return null;
     }
 }
开发者ID:intermundiasolutions,项目名称:CjwPublishToolsBundle,代码行数:18,代码来源:TwigConfigFunctionsService.php

示例7: createAdditionalSchema

 /**
  * Creates additional tables specified in a configuration
  *
  * @throws \Exception
  */
 protected function createAdditionalSchema()
 {
     if (!$this->configResolver->hasParameter('sql_schema', 'siso_eshop')) {
         return;
     }
     $sqlSchema = $this->configResolver->getParameter('sql_schema', 'siso_eshop');
     foreach ($sqlSchema as $sqlFile) {
         $this->executeSqlFile($sqlFile);
     }
 }
开发者ID:silversolutions,项目名称:content-loader-bundle,代码行数:15,代码来源:DatabaseSchemaCreator.php

示例8: aPagelayoutIsConfigured

 /**
  * @Given /^a pagelayout is configured$/
  */
 public function aPagelayoutIsConfigured()
 {
     $this->configResolver->hasParameter('pagelayout');
 }
开发者ID:ezsystems,项目名称:repository-forms,代码行数:7,代码来源:PagelayoutContext.php


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