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


PHP str::ucfirst方法代码示例

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


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

示例1: send

 public function send()
 {
     if (c::get('email.disabled')) {
         return array('status' => 'error', 'msg' => l::get('email.disabled', 'Email has been disabled'));
     }
     if (!v::email($this->extractAddress($this->options['from']))) {
         return array('status' => 'error', 'msg' => l::get('email.error.invalid.sender', 'Invalid sender'));
     }
     if (!v::email($this->extractAddress($this->options['to']))) {
         return array('status' => 'error', 'msg' => l::get('email.error.invalid.recipient', 'Invalid recipient'));
     }
     if (!v::email($this->extractAddress($this->options['replyto']))) {
         return array('status' => 'error', 'msg' => l::get('email.error.invalid.replyto', 'Invalid Reply-To Address'));
     }
     if (str::length($this->options['subject']) == 0) {
         return array('status' => 'error', 'msg' => l::get('email.error.invalid.subject', 'The subject is missing'));
     }
     $method = 'sendWith' . str::ucfirst($this->options['use']);
     if (!method_exists(__CLASS__, $method)) {
         return array('status' => 'error', 'msg' => l::get('email.error.invalid.mailer', 'This email service is not supported'));
     }
     return $this->{$method}();
 }
开发者ID:scheibome,项目名称:kirbycms-extensions,代码行数:23,代码来源:email.php

示例2: array

}
/**
 * Json adapter
 */
data::$adapters['json'] = array('extension' => 'json', 'encode' => function ($data) {
    return json_encode($data);
}, 'decode' => function ($string) {
    return json_decode($string, true);
});
/**
 * Kirby data adapter
 */
data::$adapters['kd'] = array('extension' => array('md', 'txt'), 'encode' => function ($data) {
    $result = array();
    foreach ($data as $key => $value) {
        $key = str::ucfirst(str::slug($key));
        if (empty($key) or is_null($value)) {
            continue;
        }
        // escape accidental dividers within a field
        $value = preg_replace('!(\\n|^)----(.*?\\R*)!', "\$1\\----\$2", $value);
        // multi-line content
        if (preg_match('!\\R!', $value, $matches)) {
            $result[$key] = $key . ": \n\n" . trim($value);
            // single-line content
        } else {
            $result[$key] = $key . ': ' . trim($value);
        }
    }
    return implode("\n\n----\n\n", $result);
}, 'decode' => function ($string) {
开发者ID:robinandersen,项目名称:robin,代码行数:31,代码来源:data.php

示例3: ecco

        ecco(trim($variant->description()) != '', $variant->description()->kirbytext()->bidi());
        ?>
								</div>

								<?php 
        if ($variant->hasOptions) {
            ?>
									<select dir="auto" class="uk-width-1-1" name="option">
										<?php 
            foreach (str::split($variant->options()) as $option) {
                ?>
											<option value="<?php 
                echo str::slug($option);
                ?>
"><?php 
                echo str::ucfirst($option);
                ?>
</option>
										<?php 
            }
            ?>
									</select>
								<?php 
        }
        ?>

								<button <?php 
        e(inStock($variant), '', 'disabled');
        ?>
 class="uk-button uk-button-primary uk-width-1-1" type="submit" property="offers" typeof="Offer">
									<?php 
开发者ID:samnabi,项目名称:shopkit,代码行数:31,代码来源:product.php

示例4: testUcfirst

 public function testUcfirst()
 {
     $string = str::lower($this->sample);
     $this->assertEquals('Super äwesøme string', str::ucfirst($string));
 }
开发者ID:aoimedia,项目名称:kosmonautensofa,代码行数:5,代码来源:StrTest.php

示例5: foreach

    ?>
    
  </div>

  <?php 
} else {
    ?>
  

  <div class="info">
    <dl>
      <?php 
    foreach (data::siteData() as $key => $value) {
        ?>
      <dt><?php 
        echo str::ucfirst($key);
        ?>
</dt>
      <dd><?php 
        echo empty($value) ? '&nbsp;' : html($value);
        ?>
</dd>
      <?php 
    }
    ?>
        
    </dl>
  </div>

  <?php 
}
开发者ID:codecuts,项目名称:lanningsmith-website,代码行数:31,代码来源:home.php

示例6: label

 function label($var)
 {
     return '<label>' . str::ucfirst($var) . '</label>';
 }
开发者ID:nilshendriks,项目名称:kirbycms-panel,代码行数:4,代码来源:form.php

示例7: templateName

 static function templateName($name = false)
 {
     global $page;
     $template = $name ? $name : $page->template();
     $settings = settings::load($template);
     return $settings ? a::get($settings, 'title', str::ucfirst($template)) : str::ucfirst($template);
 }
开发者ID:nilshendriks,项目名称:kirbycms-panel,代码行数:7,代码来源:data.php

示例8: label

 function label($var, $field)
 {
     $text = self::multilangtext($var, $field['name']);
     $required = $field['required'] == true ? '<span class="required">*</span>' : '';
     $lang = c::get('lang.support') ? '<small>' . c::get('lang.current') . '</small>' : '';
     return '<label>' . str::ucfirst($text) . $lang . $required . '</label>';
 }
开发者ID:codecuts,项目名称:lanningsmith-website,代码行数:7,代码来源:form.php

示例9: label

 function label($var, $field)
 {
     $required = $field['required'] == true ? '<span class="required">*</span>' : '';
     return '<label>' . str::ucfirst($var) . $required . '</label>';
 }
开发者ID:04x10,项目名称:04x10.com,代码行数:5,代码来源:form.php

示例10: array

data::$adapters['json'] = array('extension' => 'json', 'encode' => function ($data) {
    return json_encode($data);
}, 'decode' => function ($string) {
    return json_decode($string, true);
});
/**
 * Kirby data adapter
 */
data::$adapters['kd'] = array('extension' => array('md', 'txt'), 'encode' => function ($data) {
    $divider = "\n----\n";
    $result = null;
    $break = null;
    $keys = array();
    foreach ($data as $key => $value) {
        $key = str::slug($key);
        $key = str::ucfirst(str_replace('-', '_', $key));
        if (in_array($key, $keys) || empty($key)) {
            continue;
        }
        $keys[] = $key;
        $result .= $break . $key . ': ' . trim($value);
        $break = $divider;
    }
    return $result;
}, 'decode' => function ($string) {
    // remove BOM
    $string = str_replace(BOM, '', $string);
    // explode all fields by the line separator
    $fields = explode("\n----", $string);
    // start the data array
    $data = array();
开发者ID:GilbertMiao,项目名称:gifbot,代码行数:31,代码来源:data.php


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