本文整理汇总了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;
}
示例2: getParameter
public function getParameter($parameterName, $defaultValue = null)
{
if ($this->configResolver->hasParameter($parameterName)) {
return $this->configResolver->getParameter($parameterName);
}
return $defaultValue;
}
示例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)) . ';';
}
示例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;
}
示例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);
}
示例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;
}
}
示例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);
}
}
示例8: aPagelayoutIsConfigured
/**
* @Given /^a pagelayout is configured$/
*/
public function aPagelayoutIsConfigured()
{
$this->configResolver->hasParameter('pagelayout');
}