Coduo\TuTu\ServiceContainer::setParameter PHP Method

setParameter() public method

public setParameter ( $id, $value )
$id
$value
    public function setParameter($id, $value)
    {
        $this->parameters[$id] = $value;
    }

Usage Example

Example #1
0
 private function loadConfiguration()
 {
     $config = $this->parseConfiguration();
     if (array_key_exists('autoload', $config)) {
         $this->container->getService('class_loader')->addPrefixes($config['autoload']);
     }
     if (array_key_exists('parameters', $config)) {
         if (!is_array($config['parameters'])) {
             throw new \RuntimeException("Parameters key in config.yml must be a valid array.");
         }
         foreach ($config['parameters'] as $id => $value) {
             $this->container->setParameter($id, $value);
         }
     }
     if (array_key_exists('extensions', $config)) {
         foreach ($config['extensions'] as $extensionClass => $constructorArguments) {
             $arguments = $this->getExtensionArgumentsValues($constructorArguments);
             $extension = $this->container->getService('extension.initializer')->initialize($extensionClass, $arguments);
             $extension->load($this->container);
         }
     }
 }
All Usage Examples Of Coduo\TuTu\ServiceContainer::setParameter