getValue() public method

Get config value
public getValue ( string $data, string $field = 'identifier' ) : string
$data string Data
$field string Optional database field, by default 'identifier'
return string value
Beispiel #1
0
 /**
  * Constructor
  *
  * @param CoreConfig $configTable Config table
  */
 public function __construct(CoreConfig $configTable = null)
 {
     if ($configTable === null) {
         throw new Exception('Invalid parameter, $config must be an instance of \\Gc\\Core\\Config');
     }
     $this->configTable = $configTable;
     $config = @unserialize($this->configTable->getValue('module_addthis'));
     $this->config = array_merge($this->defaultOptions, $config ? $config : array());
     parent::__construct();
 }
Beispiel #2
0
 /**
  * Generates an url with the given path.
  *
  * @param string $path Path
  *
  * @return string  Url
  */
 public function __invoke($path)
 {
     if ($this->basePath === null) {
         $scheme = $this->request->getUri()->getScheme();
         if ($this->config->getValue('force_frontend_ssl') or $scheme === 'https') {
             $basePath = $this->config->getValue('secure_cdn_base_path');
         } else {
             $basePath = $this->config->getValue('unsecure_cdn_base_path');
         }
         $this->basePath = rtrim($basePath, '/');
     }
     return $this->basePath . '/' . ltrim($path, '/');
 }
Beispiel #3
0
 /**
  * Get data
  *
  * @param string $identifier Identifier
  *
  * @return string
  */
 public function get($identifier)
 {
     return $this->config->getValue($identifier);
 }