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


PHP Strings::firstUpper方法代码示例

本文整理汇总了PHP中Nette\Utils\Strings::firstUpper方法的典型用法代码示例。如果您正苦于以下问题:PHP Strings::firstUpper方法的具体用法?PHP Strings::firstUpper怎么用?PHP Strings::firstUpper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Nette\Utils\Strings的用法示例。


在下文中一共展示了Strings::firstUpper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getChangeDescription

 public function getChangeDescription()
 {
     if ($this->count === 1) {
         return $this->changeInfos[0]->getChangeDescription();
     }
     return Strings::firstUpper(StringUtils::verbToPastTense($this->getAction())) . " {$this->count} term-meta";
 }
开发者ID:wp-cpm,项目名称:versionpress,代码行数:7,代码来源:BulkTermMetaChangeInfo.php

示例2: __construct

 /**
  * @param Task $task
  * @param \SimpleXMLElement|null $pmml
  * @param DatabaseFactory $databaseFactory
  * @param PreprocessingFactory $preprocessingFactory
  * @param string $appVersion =''
  */
 public function __construct(Task $task, \SimpleXMLElement $pmml = null, DatabaseFactory $databaseFactory, PreprocessingFactory $preprocessingFactory, $appVersion = '')
 {
     if ($task instanceof Task) {
         $this->task = $task;
         $this->miner = $task->miner;
     }
     $this->appVersion = $appVersion;
     if (!empty($pmml)) {
         if ($pmml instanceof \SimpleXMLElement) {
             $this->pmml = $pmml;
         } elseif (is_string($pmml)) {
             $this->pmml = simplexml_load_string($pmml);
         }
     }
     if (!$pmml instanceof \SimpleXMLElement) {
         $this->prepareBlankPmml();
     }
     $this->appendTaskInfo();
     $this->databaseFactory = $databaseFactory;
     $this->preprocessingFactory = $preprocessingFactory;
     $connectivesArr = Cedent::getConnectives();
     foreach ($connectivesArr as $connective) {
         $this->connectivesArr[$connective] = Strings::firstUpper($connective);
     }
 }
开发者ID:kizi,项目名称:easyminer-easyminercenter,代码行数:32,代码来源:GuhaPmmlSerializer.php

示例3: annotationBeautify

 /**
  * @param string $name
  * @return string
  */
 public function annotationBeautify($name)
 {
     if (isset($this->rename[$name])) {
         $name = $this->rename[$name];
     }
     return Nette\Utils\Strings::firstUpper($name);
 }
开发者ID:brighten01,项目名称:opencloud-zendframework,代码行数:11,代码来源:AnnotationFilters.php

示例4: checkDimension

 /**
  * Check value of dimension
  *
  * @param int|string $dimension
  * @param string $type
  */
 private function checkDimension($dimension, $type)
 {
     // dimension must be number or percent
     if (Validators::is($dimension, 'string') && !Validators::isNumeric($dimension) && !Strings::endsWith($dimension, '%')) {
         $msg = sprintf('Dimension of %s has unexpected format, "%s" given.', $type, $dimension);
         throw new InvalidArgumentException($msg);
     }
     // dimension cannot be negative number
     if ((int) $dimension < 0) {
         $msg = sprintf('Dimension of %s must be greater than 0, "%s" given.', $type, $dimension);
         throw new InvalidArgumentException($msg);
     }
     // cannot be generate new image greater than 200 % of original image
     // is number
     $originDimension = $this->image->{'get' . Strings::firstUpper($type)}();
     if (Validators::isNumeric($dimension) && $dimension > $originDimension * 2) {
         $msg = sprintf('Required %s cannot be greater than 200 percent of original, "%s" required and "%s" is original.', $type, $dimension, $originDimension);
         throw new InvalidArgumentException($msg);
     }
     // is percent
     if (Strings::endsWith($dimension, '%') && (int) $dimension > 200) {
         $msg = sprintf('Required %s cannot be greater than 200 percent of original, "%s" required.', $type, $dimension);
         throw new InvalidArgumentException($msg);
     }
 }
开发者ID:lawondyss,项目名称:imager,代码行数:31,代码来源:Image.php

示例5: getChangeDescription

 public function getChangeDescription()
 {
     $verb = "Edited";
     $subject = "term-meta '{$this->metaKey}'";
     $rest = "for term '{$this->termName}'";
     if ($this->getAction() === "create" || $this->getAction() === "delete") {
         $verb = Strings::firstUpper(StringUtils::verbToPastTense($this->getAction()));
     }
     return sprintf("%s %s %s", $verb, $subject, $rest);
 }
开发者ID:wp-cpm,项目名称:versionpress,代码行数:10,代码来源:TermMetaChangeInfo.php

示例6: loadCategories

 private function loadCategories()
 {
     try {
         $categories = $this->categoryFacade->findAll();
         foreach ($categories->items as $category) {
             $this->categories[$category->id] = Strings::firstUpper($category->name);
         }
     } catch (EntitiesNotFoundException $ex) {
         \Tracy\Debugger::log($ex);
     }
 }
开发者ID:jaromir92,项目名称:Sportwin,代码行数:11,代码来源:AddArticleForm.php

示例7: signalReceived

 /**
  * @param string
  */
 public function signalReceived($signal)
 {
     $methodName = sprintf('handle%s', \Nette\Utils\Strings::firstUpper($signal));
     if (!method_exists($this, $methodName)) {
         throw new \Nette\Application\UI\BadSignalException(sprintf('Method %s does not exist', $methodName));
     }
     $presenterComponentReflection = new PresenterComponentReflection(get_called_class());
     $methodReflection = $presenterComponentReflection->getMethod($methodName);
     $args = $presenterComponentReflection->combineArgs($methodReflection, $this->params);
     $methodReflection->invokeArgs($this, $args);
 }
开发者ID:nella,项目名称:forms-signal-control,代码行数:14,代码来源:SignalControl.php

示例8: create

 /**
  * @param \App\type $id
  * @return \App\PresenterLinkSettings
  */
 public function create($id)
 {
     $item = $this->menuItemDataSource->get($id, function (Selection $context) {
         $pageKey = ':menu_has_presenter.presenter.code';
         $context->select('section.module, menu.section_id, menu.name');
         $context->select("{$pageKey}");
         $context->where("{$pageKey} IS NOT NULL");
     });
     $module = Strings::capitalize($item->module);
     $presenter = Strings::firstUpper($item->code);
     return $this->presenterLinkSettingsFactory->create(":{$module}:{$presenter}:", []);
 }
开发者ID:kysela-petr,项目名称:generator-kysela,代码行数:16,代码来源:MenuPresenterLink.php

示例9: getChangeDescription

 public function getChangeDescription()
 {
     $taxonomy = $this->getTaxonomyName();
     switch ($this->getAction()) {
         case "create":
             return "New {$taxonomy} '{$this->termName}'";
         case "delete":
             return "Deleted {$taxonomy} '{$this->termName}'";
         case "rename":
             return Strings::firstUpper($taxonomy) . " '{$this->oldTermName}' renamed to '{$this->termName}'";
     }
     return "Edited {$taxonomy} '{$this->termName}'";
 }
开发者ID:wp-cpm,项目名称:versionpress,代码行数:13,代码来源:TermChangeInfo.php

示例10: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     // get wordpress database object (no injection sorry!
     global $wpdb;
     // variables
     $this->database = $wpdb;
     $this->settings = new \SimpleSubscribe\Settings(SUBSCRIBE_KEY);
     $this->settingsAll = $this->settings->getSettings();
     // we get the table name from class name
     preg_match('#Repository(\\w+)$#', get_class($this), $class);
     $tablePreName = \Nette\Utils\Strings::contains($class[1], 'Subscribers') ? $class[1] : 'Subscribers' . $class[1];
     $this->tableName = $this->database->prefix . Utils::camelCaseToUnderscore($tablePreName);
     $this->tableSingleName = \Nette\Utils\Strings::firstUpper($class[1]);
     $this->count = $this->count();
 }
开发者ID:jekv,项目名称:devia,代码行数:18,代码来源:Repository.php

示例11: match

 /**
  * Maps HTTP request to a Request object.
  * @param \Nette\Http\IRequest $httpRequest
  * @return \Nette\Application\Request|NULL
  */
 public function match(IRequest $httpRequest)
 {
     $url = $httpRequest->getUrl();
     $basePath = Strings::replace($url->getBasePath(), '/\\//', '\\/');
     $cleanPath = Strings::replace($url->getPath(), "/^{$basePath}/");
     $path = Strings::replace($this->getPath(), '/\\//', '\\/');
     $pathRexExp = empty($path) ? "/^.+\$/" : "/^{$path}\\/.*\$/";
     if (!Strings::match($cleanPath, $pathRexExp)) {
         return NULL;
     }
     $cleanPath = Strings::replace($cleanPath, '/^' . $path . '\\//');
     $params = array();
     $path = $cleanPath;
     $params['action'] = $this->detectAction($httpRequest);
     $frags = explode('/', $path);
     // Resource ID.
     if (count($frags) % 2 === 0) {
         $params['id'] = array_pop($frags);
     } elseif ($params['action'] == 'read' && $this->useReadAllAction) {
         $params['action'] = 'readAll';
     }
     $presenterName = Strings::firstUpper(array_pop($frags));
     // Allow to use URLs like domain.tld/presenter.format.
     $formats = join('|', array_keys($this->formats));
     if (Strings::match($presenterName, "/.+\\.({$formats})\$/")) {
         list($presenterName, $format) = explode('.', $presenterName);
     }
     // Associations.
     $assoc = array();
     if (count($frags) > 0 && count($frags) % 2 === 0) {
         foreach ($frags as $k => $f) {
             if ($k % 2 !== 0) {
                 continue;
             }
             $assoc[$f] = $frags[$k + 1];
         }
     }
     $params['format'] = $this->detectFormat($httpRequest);
     $params['associations'] = $assoc;
     $params['data'] = $this->readInput();
     $params['query'] = $httpRequest->getQuery();
     $presenterName = empty($this->module) ? $presenterName : $this->module . ':' . $presenterName;
     $appRequest = new Request($presenterName, $httpRequest->getMethod(), $params);
     return $appRequest;
 }
开发者ID:dansilovsky,项目名称:calendar,代码行数:50,代码来源:AdamRestRoute.php

示例12: createComponentSearchForm

 protected function createComponentSearchForm()
 {
     $form = new \Nette\Forms\BootstrapPHForm();
     $form->setTranslator($this->presenter->translator->domain('dictionary.main'));
     $form->setMethod("GET");
     $form->getElementPrototype()->class = "form-inline";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden('idr', 'ID:');
     $form->addText('src')->setAttribute("class", "form-control")->setAttribute("placeholder", \Nette\Utils\Strings::firstUpper("src"));
     $form->addText("priceFrom")->setAttribute("style", "width: 50px;");
     $form->addText("priceTo")->setAttribute("style", "width: 50px;");
     $form->addText("brand");
     if ($this->getParameter("id")) {
         $form->setDefaults(array("idr" => $this->presenter->getParameter("id")));
     }
     $form->addSubmit('submitm', 'dictionary.main.Search')->setAttribute("class", "btn btn-info btn-lg");
     $form->onSuccess[] = $this->searchFormSucceeded;
     return $form;
 }
开发者ID:caloriscz,项目名称:caloriscms,代码行数:20,代码来源:AdvancedSearchControl.php

示例13: getChangeDescription

 public function getChangeDescription()
 {
     $verb = "Edited";
     $subject = "post-meta '{$this->metaKey}'";
     $rest = "for {$this->postType} '{$this->postTitle}'";
     if ($this->metaKey === "_thumbnail_id") {
         // featured image
         $verb = "Changed";
         $subject = "featured image";
         if ($this->getAction() === "create") {
             $verb = "Set";
         }
         if ($this->getAction() === "delete") {
             $verb = "Removed";
         }
     } elseif ($this->getAction() === "create" || $this->getAction() === "delete") {
         $verb = Strings::firstUpper(StringUtils::verbToPastTense($this->getAction()));
     }
     return sprintf("%s %s %s", $verb, $subject, $rest);
 }
开发者ID:wp-cpm,项目名称:versionpress,代码行数:20,代码来源:PostMetaChangeInfo.php

示例14: match

 public function match(IRequest $httpRequest)
 {
     $url = $httpRequest->getUrl();
     $basePath = Strings::replace($url->getBasePath(), '/\\//', '\\/');
     $cleanPath = Strings::replace($url->getPath(), "/^" . $basePath . "/");
     $path = Strings::replace($this->_getPath(), '/\\//', '\\/');
     $pathRexExp = empty($path) ? "/^.+\$/" : "/^" . $path . "\\/.*\$/";
     if (!Strings::match($cleanPath, $pathRexExp)) {
         return;
     }
     $params = $httpRequest->getQuery();
     // Get presenter action
     if (!isset($params['action']) || empty($params['action'])) {
         $params['action'] = $this->_detectAction($httpRequest);
     }
     $frags = explode('/', Strings::replace($cleanPath, '/^' . $path . '\\//'));
     $resource = Strings::firstUpper($frags[0]);
     // Set 'id' parameter if not custom action
     if (isset($frags[1]) && $this->_isApiAction($params['action'])) {
         $params['id'] = $frags[1];
     }
     return new Request(empty($this->module) ? $resource : $this->module . ':' . $resource, $httpRequest->getMethod(), $params);
 }
开发者ID:bauer01,项目名称:unimapper-nette,代码行数:23,代码来源:Route.php

示例15: __call

 /**
  * Render method hook
  *
  * @param string $func
  * @param array $args
  * @return mixed|void
  */
 public function __call($func, $args = [])
 {
     if (Nette\Utils\Strings::startsWith($func, 'render')) {
         // Fix array-in-array when passing parameters from template
         // See http://forum.nette.org/cs/21090-makro-control-obaluje-pojmenovane-parametry-polem (in czech)
         $tmp = @array_reduce($args, 'array_merge', []);
         // @ - intentionally
         if ($tmp === NULL) {
             $tmp = $args;
         }
         // Capitalize and validate view syntax
         $this->view = Nette\Utils\Strings::firstUpper($this->view);
         $this->checkView();
         // Call view and render methods
         $render = Nette\Utils\Strings::substring($func, 6);
         $this->callViewRender($render, $tmp);
         // Life cycle
         if ($this instanceof IHasControlLifeCycle) {
             return $this->run($render, $tmp);
         }
     }
     return parent::__call($func, $args);
 }
开发者ID:zaxcms,项目名称:ui,代码行数:30,代码来源:TControlLifeCycle.php


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