Create a single filter

@param string $name The name of the filter to build.
@param array $config The configuration for the filter.
@return \MiniAsset\Filter\FilterInterface
182618
protected function buildFilter($name, $config)
    {
        $className = App::className($name, 'Filter');
        if (!class_exists($className)) {
            $className = App::className('AssetCompress.' . $name, 'Filter');
        }
        $className = $className ?: $name;

        return parent::buildFilter($className, $config);
    }
211615
public function createSubsidiary($name, $config)
    {
        if (!is_string($name) || empty($name)) {
            return null;
        }
        $className = '';
        if (class_exists($name)) {
            $className = $name;
        } elseif (array_key_exists($name, $this->subsidiaryMap)) {
            $className = $this->getSubsidiaryClass($name);
        } else {
            return null;
        }
        return $this->create($className, $config);
    }
627025
public static function createWithConfig(array $config = []) {
        $plates = new self();

        $plates->register(new PlatesExtension());
        $plates->register(new Extension\Data\DataExtension());
        $plates->register(new Extension\Path\PathExtension());
        $plates->register(new Extension\RenderContext\RenderContextExtension());
        $plates->register(new Extension\LayoutSections\LayoutSectionsExtension());
        $plates->register(new Extension\Folders\FoldersExtension());

        $plates->addConfig($config);

        return $plates;
    }
1140707
protected function buildTask($name, $config)
    {
        $container = $this->container;
        $command   = new Command($name);
        $command->setApplication($container->get('application'));
        $command->setDescription($config['description']);
        $command->setCode(function (InputInterface $input, OutputInterface $output) use ($name, $config, $container) {
            $formatter = $container->get('application')->getHelperSet()->get('formatter');
            $output->writeln(
                $formatter->formatBlock(array(sprintf('Running Task "%s"', $name)), 'info')
            );
            $successful = 0;
            foreach ($config['requires'] as $task) {
                $output->writeln(
                    $formatter->formatBlock(array(sprintf('Running Required Task "%s"', $task)), 'info')
                );
                $service = $container->get(sprintf('task.'.$task));
                $code = $service->run($input, $output);
                if (0 !== $code) {
                    $successful = -1;
                }
            }

            foreach ($config['commands'] as $cmd => $cmdConfig) {
                $output->writeln(
                    $formatter->formatBlock(array(sprintf('Running Command "%s"', $cmd)), 'info')
                );
                $serviceId = sprintf('command.%s', $cmdConfig['command']);
                if (!$container->has($serviceId)) {
                    $output->writeln(
                        $formatter->formatSection(
                            '<error>ERROR</error>',
                            sprintf('Command "%s" does not exist', $cmdConfig['command'])
                        )
                    );
                    $successful = -1;
                    continue;
                }

                $serviceConfig = array('command' => $cmdConfig['command']);
                $service       = $container->get($serviceId);
                $service->setApplication($container->get('application'));

                foreach ($cmdConfig['arguments'] as $arg => $value) {
                    $serviceConfig[$arg] = $value;
                }

                foreach ($cmdConfig['options'] as $opt => $value) {
                    $serviceConfig['--'.$opt] = $value;
                }

                $code = $service->run(new ArrayInput($serviceConfig), $output);

                if (0 !== $code) {
                    $successful = -1;
                    $output->writeln(
                        $formatter->formatBlock(array(sprintf('Command "%s" failure', $cmd)), 'error')
                    );
                } else {
                    $output->writeln(
                        $formatter->formatBlock(array(sprintf('Command "%s" success', $cmd)), 'info')
                    );
                }
            }

            return $successful;
        });

        return $command;
    }
1287686
public function mergeExtension($name, array $config)
    {
        $this->addExtension($name, array_merge(
            $this->getExtension($name),
            $config
        ));
    }
959076
public static function newInstance($name, $data = null)
  {
    if (!is_array($data)) {
      $data = array();
    }

    $config = self::getInstance($name);
    $config->_data = $data;

    return $config;
  }
1281312
protected function callCustomCreator($name, array $config)
    {
        return $this->customCreators[$config['driver']]($this->app, $name, $config);
    }
123110
protected function callCustomCreator($name, array $config)
    {
        $driver = $config['driver'];

        $callback = $this->customCreators[$driver];

        return call_user_func($callback, $this->app, $name, $config);
    }
461876
public function searchByName( $name, $config = [] ) {

		$modelClass	= static::$modelClass;
		$modelTable	= $this->getModelTable();

		$config[ 'columns' ] = [ "$modelTable.id", "$modelTable.name", "$modelTable.latitude", "$modelTable.longitude", "$modelTable.postal" ];

		$config[ 'order' ] = 'name ASC';

		return $this->baseSearchByName( $name, $config );
	}
1049412
public function addConnection(array $config, $name = 'default')
	{
		$connections = $this->prop['database.connections'];
		$connections[$name] = $config;
		$this->prop['database.connections'] = $connections;
	}
95191
public function appendExtension($name, array $config = [])
    {
        $merged = array_merge_recursive(
            $this->getExtension($name),
            $config
        );

        $this->addExtension($name, $merged);
    }
1270328
public function make(array $config): ProfileBuilder
    {
        $config = $this->getConfig($config);

        return $this->getProfileBuilder($config);
    }
430113
public static function make(array $config)
    {
        $builder = self::getBuilder();
        $configObject = $builder->build($config);
        $grid = new Grid($configObject);
        return $grid;
    }
76053
public function createFromConfig(array $config)
    {
        $class = key($config);
        $this->checkMappingIsValid($class);

        return new ClassArgumentObject($this->mapping[$class]->getInstance(), $config[$class]);
    }
705583
protected function makeListColumn($name, $config)
    {
        if (is_string($config)) {
            $label = $config;
        }
        elseif (isset($config['label'])) {
            $label = $config['label'];
        }
        else {
            $label = studly_case($name);
        }

        /*
         * Auto configure pivot relation
         */
        if (starts_with($name, 'pivot[') && strpos($name, ']') !== false) {
            $_name = HtmlHelper::nameToArray($name);
            $relationName = array_shift($_name);
            $valueFrom = array_shift($_name);

            if (count($_name) > 0) {
                $valueFrom  .= '['.implode('][', $_name).']';
            }

            $config['relation'] = $relationName;
            $config['valueFrom'] = $valueFrom;
            $config['searchable'] = false;
        }
        /*
         * Auto configure standard relation
         */
        elseif (strpos($name, '[') !== false && strpos($name, ']') !== false) {
            $config['valueFrom'] = $name;
            $config['sortable'] = false;
            $config['searchable'] = false;
        }

        $columnType = $config['type'] ?? null;

        $column = new ListColumn($name, $label);
        $column->displayAs($columnType, $config);

        return $column;
    }
1343130
public function createGateway($name, array $config = array())
    {
        if (!isset($this->gateways[$name])) {
            throw new CException(sprintf('Failed to create payment gateway "%s".', $name));
        }
        $config = CMap::mergeArray($this->gateways[$name], $config);
        $gateway = Yii::createComponent($config);
        $gateway->manager = $this;
        $gateway->init();
        return $gateway;
    }
140841
public static function findByNameType( $name, $type, $config = [] ) {

		return self::queryByNameType( $name, $type, $config )->all();
	}