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


PHP Horde_String::ucwords方法代码示例

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


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

示例1: factory

 public static function factory($args = array())
 {
     $locale = isset($args['locale']) ? $args['locale'] : null;
     if ($locale && Horde_String::lower($locale) != 'base') {
         $locale = str_replace(' ', '_', Horde_String::ucwords(str_replace('_', ' ', Horde_String::lower($locale))));
         $class = 'Horde_Support_Numerizer_Locale_' . $locale;
         if (class_exists($class)) {
             return new $class($args);
         }
         list($language, ) = explode('_', $locale);
         if ($language != $locale) {
             $class = 'Horde_Support_Numerizer_Locale_' . $language;
             if (class_exists($class)) {
                 return new $class($args);
             }
         }
     }
     return new Horde_Support_Numerizer_Locale_Base($args);
 }
开发者ID:x59,项目名称:horde-support,代码行数:19,代码来源:Numerizer.php

示例2: enhance_info

/**
 * Polish the $info global from create_table_info.  adds some
 * heuristic defaults.
 */
function enhance_info()
{
    global $info, $config;
    $title_field = field_get_title_field($info);
    for ($i = 0; $i < count($info); ++$i) {
        // per default text fields are searchable:
        switch (Horde_String::lower($info[$i]['type'])) {
            // String types
            case 'string':
            case 'char':
            case 'varchar':
            case 'blob':
            case 'tinyblob':
            case 'tinytext':
            case 'mediumblob':
            case 'mediumtext':
            case 'longblob':
            case 'longtext':
                $info[$i]['search'] = 1;
                break;
            default:
                $info[$i]['search'] = 0;
        }
        // per default all non blob fields are displayed in list view
        if (is_blob($info[$i])) {
            $info[$i]['list'] = 0;
        } else {
            $info[$i]['list'] = 2;
        }
        // per default all fields are editable, except the primary_key
        // and timestamp fields
        $pk = field_get_primary_key();
        if ($info[$i]['name'] == $pk['name'] || Horde_String::lower($info[$i]['type']) == 'timestamp') {
            $info[$i]['edit'] = 0;
        } else {
            $info[$i]['edit'] = 1;
        }
        $info[$i]['view'] = 1;
        // view everything
        // Field description (displayed to user). Defaults to name.
        // Please note that underscores here result in hotkeys.
        $info[$i]['desc'] = Horde_String::ucwords($info[$i]['name']);
        // Set the flag for the title field.
        if ($info[$i]['name'] == $title_field['name']) {
            $info[$i]['flags'] .= ' title';
        }
    }
}
开发者ID:Gomez,项目名称:horde,代码行数:52,代码来源:rampage.php

示例3: tableToMapper

 /**
  * Transform a table name to a mapper class name.
  *
  * @param string $table The database table name to look up.
  *
  * @return Horde_Rdo_Mapper A new Mapper instance if it exists, else null.
  */
 public function tableToMapper($table)
 {
     if (class_exists($class = Horde_String::ucwords($table) . 'Mapper')) {
         return new $class();
     }
     return null;
 }
开发者ID:horde,项目名称:horde,代码行数:14,代码来源:Mapper.php

示例4: componentFactory

 public function componentFactory($component, $args = null)
 {
     $locale = isset($this->args['locale']) ? $this->args['locale'] : null;
     if ($locale && Horde_String::lower($locale) != 'base') {
         $locale = str_replace(' ', '_', Horde_String::ucwords(str_replace('_', ' ', Horde_String::lower($locale))));
         $class = 'Horde_Date_Parser_Locale_' . $locale . '_' . $component;
         if (class_exists($class)) {
             return new $class($args);
         }
         $language = array_shift(explode('_', $locale));
         if ($language != $locale) {
             $class = 'Horde_Date_Parser_Locale_' . $language . '_' . $component;
             if (class_exists($class)) {
                 return new $class($args);
             }
         }
     }
     $class = 'Horde_Date_Parser_Locale_Base_' . $component;
     return new $class($args);
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:20,代码来源:Base.php

示例5: camelize

 /**
  * Camel-cases a word.
  *
  * @todo Do we want locale-specific or locale-independent camel casing?
  *
  * @param string $word         The word to camel-case.
  * @param string $firstLetter  Whether to upper or lower case the first.
  *                             letter of each slash-separated section.
  *
  * @return string Camelized $word
  */
 public function camelize($word, $firstLetter = 'upper')
 {
     if ($camelized = $this->getCache($word, 'camelize' . $firstLetter)) {
         return $camelized;
     }
     $camelized = $word;
     if (Horde_String::lower($camelized) != $camelized && strpos($camelized, '_') !== false) {
         $camelized = str_replace('_', '/', $camelized);
     }
     if (strpos($camelized, '/') !== false) {
         $camelized = str_replace('/', '/ ', $camelized);
     }
     if (strpos($camelized, '_') !== false) {
         $camelized = strtr($camelized, '_', ' ');
     }
     $camelized = str_replace(' ', '', Horde_String::ucwords($camelized));
     if ($firstLetter == 'lower') {
         $parts = array();
         foreach (explode('/', $camelized) as $part) {
             $part[0] = Horde_String::lower($part[0]);
             $parts[] = $part;
         }
         $camelized = implode('/', $parts);
     }
     return $this->setCache($word, 'camelize' . $firstLetter, $camelized);
 }
开发者ID:x59,项目名称:horde-support,代码行数:37,代码来源:Inflector.php

示例6: _formatData

 /**
  *
  * @param $type
  * @param $tag
  * @param $intel
  * @param $data
  * @return unknown_type
  */
 protected function _formatData($type, $tag, $intel, $data)
 {
     switch ($type) {
         case 'ASCII':
             // Search for a null byte and stop there.
             if (($pos = strpos($data, chr(0))) !== false) {
                 $data = substr($data, 0, $pos);
             }
             // Format certain kinds of strings nicely (Camera make etc.)
             if ($tag == '010f') {
                 $data = Horde_String::ucwords(Horde_String::lower(trim($data)));
             }
             break;
         case 'URATIONAL':
         case 'SRATIONAL':
             $data = bin2hex($data);
             if ($intel == 1) {
                 $data = Horde_Image_Exif::intel2Moto($data);
             }
             if ($intel == 1) {
                 // intel stores them bottom-top
                 $top = hexdec(substr($data, 8, 8));
             } else {
                 // motorola stores them top-bottom
                 $top = hexdec(substr($data, 0, 8));
             }
             if ($intel == 1) {
                 // intel stores them bottom-top
                 $bottom = hexdec(substr($data, 0, 8));
             } else {
                 // motorola stores them top-bottom
                 $bottom = hexdec(substr($data, 8, 8));
             }
             if ($type == 'SRATIONAL' && $top > 2147483647) {
                 // this makes the number signed instead of unsigned
                 $top = $top - 4294967296;
             }
             if ($bottom != 0) {
                 $data = $top / $bottom;
             } elseif ($top == 0) {
                 $data = 0;
             } else {
                 $data = $top . '/' . $bottom;
             }
             // Exposure Time
             if ($tag == '829a') {
                 if ($bottom != 0) {
                     $data = $top . '/' . $bottom;
                 } else {
                     $data = 0;
                 }
             }
             break;
         case 'USHORT':
         case 'SSHORT':
         case 'ULONG':
         case 'SLONG':
         case 'FLOAT':
         case 'DOUBLE':
             $data = bin2hex($data);
             if ($intel == 1) {
                 $data = Horde_Image_Exif::intel2Moto($data);
             }
             if ($intel == 0 && ($type == 'USHORT' || $type == 'SSHORT')) {
                 $data = substr($data, 0, 4);
             }
             $data = hexdec($data);
             if ($type == 'SSHORT' && $data > 32767) {
                 // this makes the number signed instead of unsigned
                 $data = $data - 65536;
             }
             if ($type == 'SLONG' && $data > 2147483647) {
                 // this makes the number signed instead of unsigned
                 $data = $data - 4294967296;
             }
             break;
         case 'UNDEFINED':
             // ExifVersion,FlashPixVersion,InteroperabilityVersion
             if ($tag == '9000' || $tag == 'a000' || $tag == '0002') {
                 $data = sprintf(Horde_Image_Translation::t("version %d"), $data / 100);
             }
             break;
         default:
             $data = bin2hex($data);
             if ($intel == 1) {
                 $data = Horde_Image_Exif::intel2Moto($data);
             }
             break;
     }
     return $data;
 }
开发者ID:horde,项目名称:horde,代码行数:99,代码来源:Bundled.php


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