Jarves\Jarves::getConfig PHP Method

getConfig() public method

Returns a configuration for a bundle.
public getConfig ( $bundleName ) : Bundle | null
$bundleName
return Jarves\Configuration\Bundle | null
    public function getConfig($bundleName)
    {
        $bundle = $this->getBundle($bundleName);
        if ($bundle) {
            return $this->getConfigs()->getConfig($bundle->getName());
        }
        return null;
    }

Usage Example

示例#1
0
文件: Objects.php 项目: jarves/jarves
 /**
  * Returns the namespace of the bundle of the object key.
  *
  * JarvesBundle/node => JarvesBundle.
  * bundleWithNameSpace/myObject => Bundle\With\Namespace.
  *
  * @param  string $objectKey
  *
  * @return string
  */
 public function getNamespace($objectKey)
 {
     $objectKey = Objects::normalizeObjectKey($objectKey);
     $temp = explode('/', $objectKey);
     $config = $this->jarves->getConfig($temp[0]);
     return $config ? $config->getBundleClass()->getNamespace() : null;
 }
All Usage Examples Of Jarves\Jarves::getConfig