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


PHP UTF8::ucwords方法代码示例

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


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

示例1: update

 /**
  * Overload Sprig::update() to save revision change
  * @param bump  whether to bump the version number
  */
 public function update($bump = TRUE)
 {
     Kohana::$log->add(Kohana::DEBUG, 'Executing Versioned_Sprig::update');
     $updated = FALSE;
     foreach ($this->_fields as $field => $object) {
         if ($object instanceof Sprig_Field_Tracked and $this->changed($field)) {
             $this->comment = UTF8::ucwords($object->label) . ' changed from "' . $this->_original[$field] . '" to "' . $this->_changed[$field] . '".';
         }
         if ($object instanceof Sprig_Field_Versioned and $this->changed($field) and $bump) {
             $diff = '';
             if ($this->version != 0) {
                 $diff = Versioned::diff($this->_original[$field], $this->_changed[$field]);
                 $diff = Versioned::clean_array($diff);
                 $diff = serialize($diff);
             }
             $this->version++;
             $revision = Sprig::factory($this->_model . '_revision');
             $revision->values(array('entry' => $this->id, 'version' => $this->version, 'editor' => $this->editor, 'diff' => $diff));
             $revision->comments = $this->comments;
             $revision->create();
             $updated = TRUE;
             $this->comments = array();
         }
     }
     if (!$updated and count($this->comments) > 0) {
         $revision = Sprig::factory($this->_model . '_revision');
         $revision->entry = $this->id;
         $revision->version = $this->version;
         $revision->load();
         $revision->comments = array_merge($revision->comments, $this->comments);
         $revision->update();
     }
     return parent::update();
 }
开发者ID:vimofthevine,项目名称:versioned,代码行数:38,代码来源:sprig.php

示例2: test_ucwords

 /**
  * Tests UTF8::ucwords
  *
  * @test
  * @dataProvider provider_ucwords
  */
 public function test_ucwords($input, $expected)
 {
     $this->assertSame($expected, UTF8::ucwords($input));
 }
开发者ID:azuya,项目名称:Wi3,代码行数:10,代码来源:UTF8Test.php

示例3: humanize

 /**
  * Humanize
  *
  * Takes multiple words separated by the separator and changes them to spaces
  *
  * @param       string      $str            Input string
  * @param       string      $separator      Input separator
  * @return      string
  */
 function humanize($str, $separator = '_')
 {
     return UTF8::ucwords(preg_replace('/[' . preg_quote($separator) . ']+/' . (IS_UTF8_CHARSET && PCRE_UTF8_INSTALLED ? 'u' : ''), ' ', UTF8::trim(UTF8::strtolower($str))));
 }
开发者ID:roniwahyu,项目名称:starter-public-edition-3,代码行数:13,代码来源:MY_inflector_helper.php

示例4: label

 public function label($name, array $attr = NULL)
 {
     return Form::label($name, UTF8::ucwords($this->label), $attr);
 }
开发者ID:kerkness,项目名称:sprig,代码行数:4,代码来源:field.php

示例5: label

 public function label($name, array $attr = NULL)
 {
     if (is_array($this->label)) {
         if (isset($this->label[2])) {
             $attr = $this->label[2];
         }
         if (isset($this->label[1]) and is_bool($this->label[1])) {
             $autoformat = $this->label[1];
         } else {
             $autoformat = TRUE;
         }
         if ($autoformat) {
             return Form::label($name, html::chars(UTF8::ucwords($this->label[0])), $attr);
         } else {
             return Form::label($name, $this->label[0], $attr);
         }
     } else {
         return Form::label($name, UTF8::ucwords($this->label), $attr);
     }
 }
开发者ID:adisuryadi,项目名称:sprig,代码行数:20,代码来源:field.php


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