當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。