本文整理汇总了PHP中context::get方法的典型用法代码示例。如果您正苦于以下问题:PHP context::get方法的具体用法?PHP context::get怎么用?PHP context::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类context
的用法示例。
在下文中一共展示了context::get方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: procCashpayDoIt
/**
* @brief pay
*/
function procCashpayDoIt()
{
$oEpayController = getController('epay');
$vars = Context::getRequestVars();
$output = $oEpayController->beforePayment($vars);
if (!$output->toBool()) {
return $output;
}
$obj = new stdClass();
$obj->bank_name = $this->module_info->bank_name;
$obj->account_number = $this->module_info->account_number;
$obj->account_holder = $this->module_info->account_holder;
$output = new Object();
$output->add('transaction_srl', Context::get('transaction_srl'));
$output->add('state', '1');
// not completed
$output->add('payment_method', 'BT');
$output->add('payment_amount', Context::get('price'));
$output->add('result_code', '0');
$output->add('result_message', 'success');
$output->add('pg_tid', $this->keygen());
$output->add('vact_bankname', $obj->bank_name);
$output->add('vact_num', $obj->account_number);
$output->add('vact_name', $obj->account_holder);
$output->add('vact_inputname', context::get('depositor_name'));
// afterPayment will call an after trigger
$output = $oEpayController->afterPayment($output);
if (!$output->toBool()) {
return $output;
}
$return_url = $output->get('return_url');
if ($return_url) {
$this->setRedirectUrl($return_url);
}
}
示例2: array
}
}
}
$user_SQL = "SELECT u.user_id, u.name, u.usergroup FROM {PREFIX}user AS u WHERE u.email = :email";
$user_params = array(":email" => $return_params[":email"], ":name" => $name, ":usergroup" => $usergroup);
if ($user_result = \db::query($user_SQL, array(":email" => $return_params[":email"]))) {
$user_result = $user_result[0];
if (\context::get("profile") && \context::get("profile") === \user::me()) {
$user_SQL = "UPDATE `{PREFIX}user` SET name = :name WHERE email = :email";
\db::query($user_SQL, $user_params);
} elseif ($user_result["name"] != $name || $user_result["usergroup"] != $usergroup) {
$user_SQL = "UPDATE `{PREFIX}user` SET name = :name, usergroup = :usergroup WHERE email = :email";
\db::query($user_SQL, $user_params);
}
} else {
if (\context::get("profile") && \context::get("profile") === \user::me() && !is_numeric($user_params[":usergroup"])) {
$user_params[":usergroup"] = 0;
}
$user_SQL = "INSERT INTO `{PREFIX}user` (`email`, `name`, `usergroup`) VALUES (:email, :name, :usergroup)";
\db::insert($user_SQL, $user_params);
}
}
if ($saved) {
$url = \bootstrap::get("url");
echo <<<HTML
<h1 class="client-form-success text-success">Saved successfully!</h1>
<script>
\tsetTimeout(function() {
\t\twindow.location.href = "admin/{$url}";
\t}, 1000);
</script>
示例3: array
<?php
/**
* Created by PhpStorm.
* User: csibi
* Date: 2014.10.23.
* Time: 16:23
*/
//$newpwd = \context::get("pwd");
$email = \context::get("email");
$address = $email;
$header = array("Subject" => "New password", "FromName" => "Appetizer");
示例4:
<tr>
<td class="wrapper last">
<h2>Dear <?php
echo context::get("email");
?>
!</h2>
<h4>You've just asked for a new password!</h4>
<p>
Your new password is:
</p>
<!-- BEGIN: Note Panel -->
<table class="twelve columns" style="margin-bottom: 10px">
<tr>
<td class="panel">
<?php
echo context::get("pwd");
?>
</td>
<td class="expander">
</td>
</tr>
</table>
<!-- END: Note Panel -->
</td>
</tr>
</table>
<span class="devider">
</span>
<table class="row">
<tr>
<td class="wrapper last">
示例5: getNproductItemInfos
/**
* @brief
*/
function getNproductItemInfos()
{
$oMemberModel =& getModel('member');
$document_srls = Context::get('document_srls');
$logged_info = Context::get('logged_info');
if (!$document_srls) {
return new Object(-1, 'no srls');
}
if (Context::get('image_width') && Context::get('image_height')) {
$image_width = Context::get('image_width');
$image_height = context::get('image_height');
} else {
$image_width = 50;
$image_height = 50;
}
$document_srls = explode(',', $document_srls);
foreach ($document_srls as $k => $v) {
$config = $this->getModuleConfig();
$args->document_srl = $v;
$output = executeQuery('nproduct.getItemInfo', $args);
if (!$output->toBool()) {
return;
}
$output->data->quantity = 1;
$items[] = $output->data;
}
if ($items) {
if ($logged_info) {
$group_list = $oMemberModel->getMemberGroups($logged_info->member_srl);
} else {
$group_list = array();
}
$items = $this->discountItems($items, $group_list, $image_width, $image_height);
$this->add('data', $items);
$this->add('module', 'nproduct');
}
return $items;
}
示例6: array
<?php
/**
* Created by PhpStorm.
* User: csibi
* Date: 2015.07.13.
* Time: 11:11
*/
$bootstrap = \bootstrap::get();
$params = $bootstrap->params;
if (\context::get("profile") && \context::get("profile") === \user::me()) {
if (!is_array($params)) {
$params = array();
}
$params["id"] = \context::get("profile");
}
if ($params && isset($params["id"])) {
echo '<div class="row client-row" style="padding: 30px; background-color: #ccc;">' . PHP_EOL;
echo \Routerunner\Routerunner::form("frm", $runner, true);
echo '</div>' . PHP_EOL;
}
示例7: getNcartFavoriteItems
function getNcartFavoriteItems()
{
if (Context::get('image_width') && Context::get('image_height')) {
$image_width = Context::get('image_width');
$image_height = context::get('image_height');
} else {
$image_width = 50;
$image_height = 50;
}
$logged_info = Context::get('logged_info');
if (!$logged_info) {
return new Object(-1, 'msg_invalid_request');
}
$member_srl = $logged_info->member_srl;
$item_list = $this->getFavoriteItems($member_srl, $image_width, $image_height);
$this->add('data', $item_list);
$this->add('item_count', count($item_list));
// mileage
$mileage = $this->getMileage($member_srl);
$this->add('mileage', $mileage);
}
示例8:
echo context::get("email");
?>
!</h2>
<h4>Forgotten password request received from your e-mail address!</h4>
<p>
Please click the following URL to get a new password:
</p>
<!-- BEGIN: Note Panel -->
<table class="twelve columns" style="margin-bottom: 10px">
<tr>
<td class="panel">
<a href="<?php
echo context::get("confirm_code");
?>
"><?php
echo context::get("confirm_code");
?>
</a>
</td>
<td class="expander">
</td>
</tr>
</table>
<p>
If clicking the URL above does not work, copy and paste the URL into a browser window.
</p>
<!-- END: Note Panel -->
</td>
</tr>
</table>
<span class="devider">
示例9: array
}
$usergroups = array();
$SQL = "SELECT usergroup_id, label FROM {PREFIX}usergroup ORDER BY usergroup_id";
if ($result = \db::query($SQL)) {
foreach ($result as $row) {
$usergroups[$row["usergroup_id"]] = $row["label"];
}
}
$scopes = array();
$SQL = "SELECT id, label FROM menu ORDER BY id";
if ($result = \db::query($SQL)) {
foreach ($result as $row) {
$scopes[$row["id"]] = $row["label"];
}
}
$value = array("email" => "", "name" => "", "reg_date" => time(), "confirm_date" => time(), "licence" => "", "usergroup" => "");
if ($id) {
$SQL = <<<SQL
SELECT member.email, u.name, member.reg_date, member.confirm_date, member.licence, u.usergroup, member.scope
FROM `member`
LEFT JOIN {PREFIX}user as u ON u.email = member.email
WHERE member.id = ?
SQL;
if ($result = \db::query($SQL, array($id))) {
$value = array_merge($value, $result[0]);
}
}
$debug = 1;
$input = array('id' => array('type' => 'hidden', 'field' => 'id', 'value' => $id ? $id : ""), 'nonce' => array('type' => 'hidden', 'field' => 'nonce', 'value' => $nonce), 'reg_date' => array('type' => 'hidden', 'field' => 'reg_date', 'value' => $value["reg_date"]), 'confirm_date' => array('type' => 'hidden', 'field' => 'confirm_date', 'value' => $value["confirm_date"]), 'email' => array('type' => \context::get("profile") ? 'label' : 'text', 'field' => 'email', 'label' => 'E-mail address', 'input-id' => 'frm-email', 'class' => '', 'value' => $value["email"]), 'name' => array('type' => 'text', 'field' => 'name', 'label' => 'Name', 'input-id' => 'frm-name', 'class' => '', 'value' => $value["name"]), 'pwd' => array('type' => 'password', 'field' => 'pwd', 'label' => 'Password (leave empty if not to change)', 'input-id' => 'frm-pwd', 'class' => '', 'value' => ''), 'pwd_confirm' => array('type' => 'password', 'field' => 'pwd_confirm', 'label' => 'Password confirmation', 'input-id' => 'frm-pwd_confirm', 'class' => '', 'value' => ''), 'licence' => array('type' => \context::get("profile") ? 'label' : 'date', 'field' => 'licence', 'label' => 'Licence', 'input-id' => 'frm-licence', 'class' => '', 'value' => \context::get("profile") && $value["licence"] ? strftime("%Y-%m-%d %H:%M:%S", $value["licence"]) : $value["licence"]), 'usergroup' => array('type' => \context::get("profile") ? 'label' : 'select', 'field' => 'usergroup', 'label' => 'Usergroup', 'input-id' => 'frm-usergroup', 'class' => '', 'options' => $usergroups, 'value' => \context::get("profile") ? $usergroups[$value["usergroup"]] : $value["usergroup"]), 'scope' => array('type' => \context::get("profile") ? 'label' : 'multiple', 'field' => 'scope', 'label' => 'Scope', 'input-id' => 'frm-scope', 'class' => '', 'options' => $scopes, 'value' => \context::get("profile") ? $scopes[$value["scope"]] : $value["scope"]), 'submit' => array('type' => 'submit', 'input-id' => 'frm-submit', 'value' => 'Submit changes'));
$debug = 1;