当前位置: 首页>>代码示例>>PHP>>正文


PHP Strings::findPrefix方法代码示例

本文整理汇总了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');
 }
开发者ID:vojtabiberle,项目名称:MediaStorage,代码行数:30,代码来源:Extension.php


注:本文中的Nette\Utils\Strings::findPrefix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。