本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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) {
示例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
示例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
;
示例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"));
示例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}
示例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;
示例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));
示例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');
示例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;
}
示例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;
}
示例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;
示例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;
}