本文整理汇总了PHP中Nette\Utils\Strings::findPrefix方法的典型用法代码示例。如果您正苦于以下问题:PHP Strings::findPrefix方法的具体用法?PHP Strings::findPrefix怎么用?PHP Strings::findPrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Utils\Strings
的用法示例。
在下文中一共展示了Strings::findPrefix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadConfiguration
public function loadConfiguration()
{
$config = $this->getSettings();
$builder = $this->getContainerBuilder();
/**
* Same starting point is basic point, where app lives.
*/
$config['baseDir'] = Strings::findPrefix([$config['wwwDir'], $config['appDir']]);
/*$this->compiler->parseServices($builder, $this->loadFromFile(__DIR__ . DIRECTORY_SEPARATOR . 'services.neon'), $this->name);*/
$builder->addDefinition($this->prefix('uploadFormFactory'))->setFactory('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Forms\\UploadFormFactory')->setClass('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Forms\\UploadFormFactory')->setArguments([$config['formClass'], $config['uploadFieldLabel']]);
$builder->addDefinition($this->prefix('multiuploadFormFactory'))->setFactory('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Forms\\MultiuploadFormFactory')->setClass('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Forms\\MultiuploadFormFactory')->setArguments([$config['formClass'], $config['uploadFieldLabel']]);
$builder->addDefinition($this->prefix('filterFormFactory'))->setFactory('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Forms\\FilterFormFactory')->setClass('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Forms\\FilterFormFactory')->setArguments([$config['formClass'], 'Query:']);
$builder->addDefinition($this->prefix('cardMediaViewControl'))->setClass('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Controls\\CardView\\CardViewControl');
$builder->addDefinition($this->prefix('gridMediaViewControlFactory'))->setFactory('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Controls\\GridMediaView\\GridMediaViewControlFactory');
$builder->addDefinition($this->prefix('uploadControlFactory'))->setFactory('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Controls\\Upload\\UploadControlFactory')->setArguments(['disableMultiupload' => $config['disableMultiupload']]);
$builder->addDefinition($this->prefix('ajaxUploadControlFactory'))->setFactory('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Controls\\AjaxUpload\\AjaxUploadControlFactory')->setArguments(['disableMultiupload' => $config['disableMultiupload']]);
$builder->addDefinition($this->prefix('manager'))->setClass('vojtabiberle\\MediaStorage\\Manager')->setArguments(['config' => $config]);
$builder->addDefinition($this->prefix('storage'))->setClass('vojtabiberle\\MediaStorage\\Storage')->setArguments(['mediaStoragePath' => $config['baseDir'] . DIRECTORY_SEPARATOR . $config['mediaStoragePath'], 'fileClass' => $config['fileClass'], 'imageClass' => $config['imageClass']]);
if (0 === count($builder->findByType('vojtabiberle\\MediaStorage\\Bridges\\IFilesystemStorage'))) {
$builder->addDefinition($this->prefix('filesystemStorage'))->setClass('vojtabiberle\\MediaStorage\\Bridges\\FilesystemStorage');
}
if (0 === count($builder->findByType('vojtabiberle\\MediaStorage\\Bridges\\IDatabaseStorage'))) {
$builder->addDefinition($this->prefix('databaseStorage'))->setClass('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Model\\MediaStorage');
}
if ($config['router']['disable'] === false) {
$builder->addDefinition($this->prefix('routerFactory'))->setFactory('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Router\\Factory::createRouter')->setClass('Nette\\Application\\IRouter')->setArguments([$config['router']])->setAutowired(false);
$builder->addDefinition($this->prefix('mediaPresenter'))->setClass('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Presenters\\MediaPresenter');
}
$builder->addDefinition($this->prefix('mediaPopupPresenter'))->setClass('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Presenters\\MediaPopupPresenter');
}