upper() static public method

An UTF-8 safe version of strotoupper()
static public upper ( string $str ) : string
$str string
return string
Beispiel #1
0
 /**
  * Gets a value from the _SERVER array
  * 
  * <code>
  * 
  * server::get('document_root');
  * // sample output: /var/www/kirby
  * 
  * server::get();
  * // returns the whole server array
  *
  * </code>   
  *
  * @param  mixed    $key The key to look for. Pass false or null to return the entire server array. 
  * @param  mixed    $default Optional default value, which should be returned if no element has been found
  * @return mixed
  */
 public static function get($key = false, $default = null)
 {
     if (empty($key)) {
         return $_SERVER;
     }
     return a::get($_SERVER, str::upper($key), $default);
 }
Beispiel #2
0
 /**
  * Gets a value from the _SERVER array
  * 
  * <code>
  * 
  * server::get('document_root');
  * // sample output: /var/www/kirby
  * 
  * server::get();
  * // returns the whole server array
  *
  * </code>   
  *
  * @param  mixed    $key The key to look for. Pass false or null to return the entire server array. 
  * @param  mixed    $default Optional default value, which should be returned if no element has been found
  * @return mixed
  */
 public static function get($key = false, $default = null)
 {
     if (empty($key)) {
         return $_SERVER;
     }
     $key = str::upper($key);
     $value = a::get($_SERVER, $key, $default);
     return static::sanitize($key, $value);
 }
 public function getMonthBoard($month, $year)
 {
     // Calendar language
     date_default_timezone_set('UTC');
     $l = panel()->language();
     setlocale(LC_ALL, $l . '_' . str::upper($l));
     //setlocale(LC_ALL, 'us_US');
     // Calendar stuff
     $cal = new Calendarboard\calendar();
     $currentMonth = $cal->month($year, $month);
     return tpl::load(__DIR__ . DS . 'template.php', array('currentMonth' => $currentMonth, 'get_day_route_url' => purl($this->model(), 'field/' . $this->field()->name . '/calendarboard/get-day/'), 'calendarboard_url' => $this->model(), 'year_folder' => '/year-' . $year));
 }
Beispiel #4
0
 /**
  * Escape character for JavaScript
  * 
  * Callback function for preg_replace_callback() that applies Javascript
  * escaping to all matches.
  * 
  * @param  array  $matches
  * @return string
  */
 protected static function escapeJSChar($matches)
 {
     $char = $matches[0];
     if (str::length($char) == 1) {
         return sprintf('\\x%02X', ord($char));
     }
     $char = static::convertEncoding($char);
     return sprintf('\\u%04s', str::upper(bin2hex($char)));
 }
if (param('section')) {
    $alphabetise = alphabetise($page->children()->filterBy('section', params('section'))->sortby('title'), array('key' => 'title'));
} else {
    $alphabetise = alphabetise($page->children()->sortby('title'), array('key' => 'title'));
}
?>

<?php 
foreach ($alphabetise as $letter => $items) {
    ?>
    <h2 class="index" id="<?php 
    echo $letter;
    ?>
"><?php 
    echo str::upper($letter);
    ?>
</h2>
    <ul class="<?php 
    echo $type;
    ?>
 listing">
    <?php 
    foreach ($items as $item) {
        ?>
        <?php 
        if ($item->short_title()->isNotEmpty()) {
            $title = $item->short_title();
        } else {
            $title = $item->title();
        }
Beispiel #6
0
 /** 
  * An UTF-8 safe version of ucfirst()
  * 
  * @param  string  $string 
  * @return string 
  */
 static function ucfirst($str)
 {
     return str::upper(str::substr($str, 0, 1)) . str::substr($str, 1);
 }
Beispiel #7
0
<!-- END HEADER -->

<!-- NAVBAR -->
<?php 
snippet('navbar');
?>
<!-- END NAVBAR -->

<!-- MAIN -->
<div class="container">
	<div class="row">
		
		<!-- title -->
		<div id="page-title" class="col-xs-12">
			<h3><?php 
echo str::upper($page->title()->html());
?>
</h3>
		</div>
		<!-- end title -->

		<!-- intro -->
		<div id="page-intro" class="col-xs-12">
			<?php 
echo $page->text();
?>
		</div>
		<!-- end intro -->

	</div>
</div>
/**
 * Converts the field value to lower case
 * @param Field $field The calling Kirby Field instance
 * @return Field
 */
field::$methods['lower'] = function ($field) {
    $field->value = str::lower($field->value);
    return $field;
};
/**
 * Converts the field value to upper case
 * @param Field $field The calling Kirby Field instance
 * @return Field
 */
field::$methods['upper'] = function ($field) {
    $field->value = str::upper($field->value);
    return $field;
};
/**
 * Applies the widont rule to avoid single 
 * words on the last line
 * @param Field $field The calling Kirby Field instance
 * @return Field
 */
field::$methods['widont'] = function ($field) {
    $field->value = widont($field->value);
    return $field;
};
/**
 * Creates a simple text excerpt without formats
 * @param Field $field The calling Kirby Field instance
Beispiel #9
0
?>
<!-- END NAVBAR -->

<!-- MAIN -->
<div id="tests-page" class="container">
	
	<div class="row">
		
		<div class="col-xs-12">
			
			<div class="row"
				
				<!-- title -->
				<div id="page-title" class="col-xs-12">
					<h3><?php 
echo str::upper($page->title());
?>
</h3>	
				</div>
				<!-- end title -->

				<?php 
if ($tests) {
    ?>
					
					<!-- take test intro -->
					<div id="page-intro" class="col-xs-12">
						<?php 
    echo $page->text()->kirbytext();
    ?>
					</div>
Beispiel #10
0
 public function testUpper()
 {
     $this->assertEquals('SUPER ÄWESØME STRING', str::upper($this->sample));
 }
Beispiel #11
0
 public function format()
 {
     return str::upper($this->format);
 }
Beispiel #12
0
 public function format()
 {
     $format = str::upper($this->format);
     return empty($format) ? 'YYYY-MM-DD' : $format;
 }
    ?>
  <select class="lang" onchange="window.location = this.value">
    <?php 
    foreach (c::get('lang.available') as $lang) {
        ?>
  
    <option value="<?php 
        echo languageToggle($lang);
        ?>
"<?php 
        if ($lang == c::get('lang.current')) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo str::upper($lang);
        ?>
</option>
    <?php 
    }
    ?>
  </select>
  <?php 
}
?>

  <?php 
snippet('pages');
?>
</div>
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//<?php 
echo $site->url();
?>
//Kirby Calendar Plugin//<?php 
echo str::upper($site->language()->code());
?>
 
METHOD:PUBLISH
<?php 
foreach ($calendar->getAllEvents() as $event) {
    ?>
BEGIN:VEVENT
DTSTART:<?php 
    echo gmdate('Ymd\\THis\\Z', $event->getBeginTimestamp());
    ?>
 
DTEND:<?php 
    echo gmdate('Ymd\\THis\\Z', $event->getEndTimestamp());
    ?>
 
SUMMARY:<?php 
    echo $event->getField('summary');
    ?>
 
DESCRIPTION:<?php 
    echo $event->getField('description');
    ?>
 
LOCATION:<?php