Nette\DI\ServiceDefinition::setArguments PHP Метод

setArguments() публичный Метод

public setArguments ( array $args = [] ) : self
$args array
Результат self
    public function setArguments(array $args = [])
    {
        if (!$this->factory) {
            $this->factory = new Statement($this->class);
        }
        $this->factory->arguments = $args;
        return $this;
    }

Usage Example

Пример #1
0
 function getAssets()
 {
     $serviceDefinition = new ServiceDefinition();
     $serviceDefinition->setClass('Mike227\\NAssetic\\AssetCollection');
     $serviceDefinition->setArguments(array(array('test6.js'), array(new TestFilter('#FILTER')), __DIR__ . '/../sources/'));
     return array('js1' => new GlobAsset(__DIR__ . '/../sources/test1.*'), 'js2' => array(new GlobAsset(__DIR__ . '/../sources/test2.*'), __DIR__ . '/../sources/test3.js', array(__DIR__ . '/../sources/test4.js', new GlobAsset(__DIR__ . '/../sources/test5.*')), 'serviceDef' => $serviceDefinition));
 }
All Usage Examples Of Nette\DI\ServiceDefinition::setArguments