本文整理匯總了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');
}