get() 정적인 공개 메소드

Gets an global value by key
static public get ( mixed $key = null, mixed $default = null ) : mixed
$key mixed The key to look for. Pass false or null to return the entire globals array.
$default mixed Optional default value, which should be returned if no element has been found
리턴 mixed
예제 #1
0
파일: map.php 프로젝트: veryrobert/altair
<?php

///////////////////////////////////////////////////////
// ----------------------------------------------------------
// SNIPPET
// ----------------------------------------------------------
/////////////////////////////////////////////////////////////
// Create instances
$instances = g::get('kmap.instances');
g::set('kmap.instances', $instances + 1);
// Set variables
if (!isset($id)) {
    $id = 'map-' . uniqid();
}
if (!isset($width)) {
    $width = 300;
}
if (!isset($height)) {
    $height = 300;
}
if (!isset($type)) {
    $type = 'roadmap';
}
// roadmap, sattelite, hybrid, terrain
if (!isset($class)) {
    $class = 'map';
}
if (!isset($zoom)) {
    $zoom = 15;
}
if (!isset($address)) {
예제 #2
0
<?php

$instances = g::get('kflattr.instances');
g::set('kflattr.instances', $instances + 1);
// set the defaults
if (!isset($user_id)) {
    die('Please pass the flattr userid');
}
if (!isset($url)) {
    $url = $page->url();
}
if (!isset($title)) {
    $title = $page->title();
}
if (!isset($description)) {
    $description = null;
}
if (!isset($category)) {
    $category = null;
}
if (!isset($language)) {
    $language = null;
}
if (!isset($tags)) {
    $tags = null;
}
if (!isset($button)) {
    $button = null;
}
if (!isset($popout)) {
    $popout = null;