當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Vars::get方法代碼示例

本文整理匯總了PHP中Vars::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vars::get方法的具體用法?PHP Vars::get怎麽用?PHP Vars::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Vars的用法示例。


在下文中一共展示了Vars::get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setLang

 /**
  * Sets initial language configuration for global use.
  */
 public function setLang()
 {
     $session = new Session();
     $vars = new Vars();
     if (!$session->exists('lang') || $vars->get('lang')) {
         $session->set('lang', $vars->get('lang') ? $vars->get('lang') : self::DEFAULT_LANG);
     }
 }
開發者ID:kasalgado,項目名稱:framework,代碼行數:11,代碼來源:Init.php

示例2: setParameters

 /**
  * Set the $post and $get variables, since they will
  * be set to the same properties in the CodonModule class
  *
  */
 public static function setParameters()
 {
     self::$post = new stdClass();
     self::$get = new stdClass();
     foreach ($_POST as $key => $value) {
         self::$post->{$key} = self::cleaned($value);
     }
     foreach ($_GET as $key => $value) {
         self::$get->{$key} = self::cleaned($value);
     }
     foreach ($_REQUEST as $key => $value) {
         self::$request->{$key} = self::cleaned($value);
     }
 }
開發者ID:Galihom,項目名稱:phpVMS,代碼行數:19,代碼來源:Vars.class.php

示例3: init

 /**
  * 本體実行前にクラスを初期化する。
  */
 static function init()
 {
     //GET、POST、COOKIEの初期化
     self::$post = $_POST;
     self::$get = $_GET;
     self::$cookie = $_COOKIE;
     if (get_magic_quotes_gpc()) {
         self::$post = map('stripslashes', self::$post);
         self::$get = map('stripslashes', self::$get);
         self::$cookie = map('stripslashes', self::$cookie);
     }
     self::$get = map('rawurldecode', self::$get);
     if (ini_get('mbstring.encoding_translation')) {
         $encode = ini_get('mbstring.internal_encoding');
         $proc = "return mb_convert_encoding(\$str, 'UTF-8', '{$encode}');";
         self::$post = map(create_function('$str', $proc), self::$post);
     }
 }
開發者ID:riaf,項目名稱:kinowiki,代碼行數:21,代碼來源:vars.inc.php

示例4: denyDirect

 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$options = NULL;
$field_value = Vars::get("value");
if (!$field_value) {
    $field_value = Vars::get('name');
}
$name = Vars::get("name");
$label = Vars::get("label");
$options_values = Vars::get("options_values");
$class = Vars::get("class");
$args = arrayToArgs(Vars::get("args"));
foreach ($options_values as $key => $value) {
    $checked = is_array($field_value) && in_array($key, $field_value) ? "checked" : "";
    $options .= <<<HTML
<div class="checkbox">
    <label>
        <input type="checkbox" value="{$key}" name="{$name}[]" {$checked}>
        {$value}
    </label>
</div>
HTML;
}
$core = <<<HTML
<div class='form-group'>
HTML;
if ($label) {
開發者ID:socialapparatus,項目名稱:socialapparatus,代碼行數:31,代碼來源:checkboxes.php

示例5: denyDirect

 * SocialApparatus CONFIDENTIAL
 * __________________
 * 
 *  [2002] - [2017] SocialApparatus (http://SocialApparatus.co) 
 *  All Rights Reserved.
 * 
 * NOTICE:  All information contained herein is, and remains the property of SocialApparatus 
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$timestamp = Vars::get("timestamp");
$date = date("c", $timestamp);
?>

<small class="text-muted">
    <i class="fa fa-clock-o"></i> 
    <time class="timeago" datetime="<?php 
echo $date;
?>
">
    </time>
</small><?php 
開發者ID:socialapparatus,項目名稱:socialapparatus,代碼行數:31,代碼來源:friendly_time.php

示例6: denyDirect

 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$value = Vars::get("value");
if (!$value) {
    $value = getInput('name');
}
$name = Vars::get("name");
$label = Vars::get("label");
if ($label) {
    $label = "<label for='{$name}'>{$label}</label>";
} else {
    $label = NULL;
}
$required = Vars::get("required");
if ($required) {
    $required = "required='required'";
} else {
    $required = NULL;
}
$class = Vars::get("class");
$placeholder = Vars::get("placeholder");
echo <<<HTML
<div class='form-group'>
    {$label}
    <input name="{$name}" type="email" class="{$class}" value="{$value}" placeholder="{$placeholder}" {$required}>
</div>
HTML
;
開發者ID:socialapparatus,項目名稱:socialapparatus,代碼行數:31,代碼來源:email.php

示例7: denyDirect

<?php

/* * ***********************************************************************
 * 
 * SocialApparatus CONFIDENTIAL
 * __________________
 * 
 *  [2002] - [2017] SocialApparatus (http://SocialApparatus.co) 
 *  All Rights Reserved.
 * 
 * NOTICE:  All information contained herein is, and remains the property of SocialApparatus 
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$inputs = Vars::get("inputs");
foreach ($inputs as $name => $value) {
    echo display("input/hidden", array("name" => $name, "value" => $value, "label" => NULL));
}
echo display("input/textarea", array("name" => "comment", "placeholder" => "Your Comment", "label" => NULL, "class" => "form-control comment_textarea", "value" => NULL));
echo display("input/submit", array("label" => "Add Comment", "class" => "btn btn-info btn-sm add_comment_submit"));
開發者ID:socialapparatus,項目名稱:socialapparatus,代碼行數:29,代碼來源:add_comment.php

示例8: denyDirect

 * 
 * NOTICE:  All information contained herein is, and remains the property of SocialApparatus 
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$guid = Vars::get("guid");
$view_type = Vars::get("view_type");
$class = NULL;
$user = getEntity($guid);
$url = $user->getURL();
$footer = display("user/buttons");
$member_body = display("user/body", array("guid" => $guid));
switch ($view_type) {
    case "list":
    default:
        $timeago = display("output/friendly_time", array("timestamp" => $user->time_created));
        $icon = $user->icon(MEDIUM, "media-object");
        echo <<<HTML
<button class="list-group-item member_list_element {$class}" data-guid="{$guid}">
    <span class="media">
        <span class="media-left">
            {$icon}
開發者ID:socialapparatus,項目名稱:socialapparatus,代碼行數:31,代碼來源:User.php

示例9: denyDirect

 * NOTICE:  All information contained herein is, and remains the property of SocialApparatus 
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$params = Vars::get("params");
$count = Vars::get("count");
$count_shown = Vars::get("count_shown");
$wrapper_id = Vars::get("wrapper_id");
$session = getInput("session");
$user = getUserFromSession($session);
if ($user) {
    $params['logged_in_user_guid'] = $user->guid;
}
echo listEntities($params);
if ($count > $count_shown) {
    $params['offset'] = $params['offset'] + $params['limit'];
    $params = json_encode($params);
    $button = "<button class='show_more btn btn-danger btn-xs pull-right' data-count='{$count}' data-count_shown='{$count_shown}' data-params='{$params}' data-id='{$wrapper_id}'>More</button>";
} else {
    $button = NULL;
}
echo $button;
開發者ID:socialapparatus,項目名稱:socialapparatus,代碼行數:31,代碼來源:entity_list_body.php

示例10: denyDirect

/* * ***********************************************************************
 * 
 * SocialApparatus CONFIDENTIAL
 * __________________
 * 
 *  [2002] - [2017] SocialApparatus (http://SocialApparatus.co) 
 *  All Rights Reserved.
 * 
 * NOTICE:  All information contained herein is, and remains the property of SocialApparatus 
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$vars = Vars::get("called_by");
$guid = pageArray(1);
$owner = getEntity($guid);
$friends = FriendsPlugin::getFriends($owner, 0, 1000);
$friends_list = viewEntityList($friends, "gallery");
$find_friends_url = getSiteURL() . "members";
$search_friends_form = drawForm(array("name" => "search_friends", "method" => "get", "page" => "searchFriends", "class" => "form-inline"));
$friends_text = translate("friends");
$find_friends_text = translate("find_friends");
echo display("page_elements/panel", array("heading" => "<a href='{$find_friends_url}' class='btn btn-success btn-xs pull-right'>{$find_friends_text}</a>{$friends_text}", "body" => $friends_list, "footer" => $search_friends_form));
開發者ID:socialapparatus,項目名稱:socialapparatus,代碼行數:31,代碼來源:profile.php

示例11: define

/**
 * @todo: Replace this code with a proper router
**/
define('DS', DIRECTORY_SEPARATOR);
define('BASEPATH', realpath(dirname(__FILE__)) . DS);
define('APPPATH', BASEPATH . 'application' . DS);
require BASEPATH . 'system' . DS . 'core.php';
define('LOGGED_IN', is_logged_in());
$smarty->assign('logged_in', LOGGED_IN);
if (isset($_SESSION['user_data']['id'])) {
    $smarty->assign('user_id', $_SESSION['user_data']['id']);
} else {
    $smarty->assign('user_id', 0);
}
/* ----- Use a router insted ----- */
$query = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';
$req_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
$request = str_replace($CFG->get('relative_path'), '', $req_uri);
$request = str_replace('?' . $query, '', $request);
$url_parts = explode('/', trim($request, '/'));
$url_parts[0] = isset($url_parts[0]) && $url_parts[0] != '' ? $url_parts[0] : '';
$url_parts = str_replace('..', '', $url_parts);
/* ---------- */
$file = plugin($url_parts);
Vars::set('args', $url_parts);
Vars::set('plain_args', implode('/', $url_parts));
require $file;
require BASEPATH . 'getRank.php';
$smarty->assign('players_rank', Vars::get('players_rank'));
$smarty->assign('guilds_rank', Vars::get('guilds_rank'));
$smarty->display('main.tpl');
開發者ID:ionutmilica,項目名稱:my-archive,代碼行數:31,代碼來源:index.php

示例12: denyDirect

 * 
 * SocialApparatus CONFIDENTIAL
 * __________________
 * 
 *  [2002] - [2017] SocialApparatus (http://SocialApparatus.co) 
 *  All Rights Reserved.
 * 
 * NOTICE:  All information contained herein is, and remains the property of SocialApparatus 
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$value = Vars::get('value');
$value = html_entity_decode($value);
$label = Vars::get('label');
if ($label) {
    $body = <<<HTML
        <strong>{$label}:  </strong>{$value}
HTML;
    echo $body;
} else {
    echo $value;
}
開發者ID:socialapparatus,項目名稱:socialapparatus,代碼行數:31,代碼來源:editor.php

示例13: clean

 /**
  * Function to strip additional / or \ in a path name.
  *
  * @param   string $path   The path to clean.
  * @param   string $dirSep Directory separator (optional).
  * @return  string
  *
  * @SuppressWarnings(PHPMD.Superglobals)
  */
 public static function clean($path, $dirSep = DIRECTORY_SEPARATOR)
 {
     if (!is_string($path) || empty($path)) {
         return '';
     }
     $path = trim((string) $path);
     if (empty($path)) {
         $path = Vars::get($_SERVER['DOCUMENT_ROOT'], '');
     } elseif ($dirSep == '\\' && $path[0] == '\\' && $path[1] == '\\') {
         $path = "\\" . preg_replace('#[/\\\\]+#', $dirSep, $path);
     } else {
         $path = preg_replace('#[/\\\\]+#', $dirSep, $path);
     }
     return $path;
 }
開發者ID:jbzoo,項目名稱:utils,代碼行數:24,代碼來源:FS.php

示例14: denyDirect

<?php

/* * ***********************************************************************
 * 
 * SocialApparatus CONFIDENTIAL
 * __________________
 * 
 *  [2002] - [2017] SocialApparatus (http://SocialApparatus.co) 
 *  All Rights Reserved.
 * 
 * NOTICE:  All information contained herein is, and remains the property of SocialApparatus 
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$classes = Vars::get("classes");
$classes = str_replace("photopicker_album_gallery_item well well-sm ", "", $classes);
$classes = str_replace(" active", "", $classes);
$classes = str_replace("album_", "", $classes);
$photos = listEntities(array("type" => "Photo", "metadata_name" => "container_guid", "metadata_value" => intval($classes), "view_type" => "photopicker_gallery"));
echo $photos;
開發者ID:socialapparatus,項目名稱:socialapparatus,代碼行數:29,代碼來源:AjaxPhotoalbum.php

示例15: pathToRel

 /**
  * Convert file path to relative URL
  *
  * @param $path
  * @return string
  *
  * @SuppressWarnings(PHPMD.Superglobals)
  */
 public static function pathToRel($path)
 {
     $root = FS::clean(Vars::get($_SERVER['DOCUMENT_ROOT']));
     $path = FS::clean($path);
     $normRoot = str_replace(DIRECTORY_SEPARATOR, '/', $root);
     $normPath = str_replace(DIRECTORY_SEPARATOR, '/', $path);
     $regExp = '/^' . preg_quote($normRoot, '/') . '/i';
     $relative = preg_replace($regExp, '', $normPath);
     $relative = ltrim($relative, '/');
     return $relative;
 }
開發者ID:jbzoo,項目名稱:utils,代碼行數:19,代碼來源:Url.php


注:本文中的Vars::get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。