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


PHP s::remove方法代碼示例

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


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

示例1: message

 public function message()
 {
     if ($message = s::get('message') and is_array($message)) {
         $text = a::get($message, 'text');
         $type = a::get($message, 'type', 'notification');
         $element = new Brick('div');
         $element->addClass('message');
         if ($type == 'error') {
             $element->addClass('message-is-alert');
         } else {
             $element->addClass('message-is-notice');
         }
         $element->append(function () use($text) {
             $content = new Brick('span');
             $content->addClass('message-content');
             $content->text($text);
             return $content;
         });
         $element->append(function () {
             $toggle = new Brick('a');
             $toggle->attr('href', url::current());
             $toggle->addClass('message-toggle');
             $toggle->html('<i>&times;</i>');
             return $toggle;
         });
         s::remove('message');
         return $element;
     }
 }
開發者ID:irenehilber,項目名稱:kirby-base,代碼行數:29,代碼來源:topbar.php

示例2: flush

 /**
  * Remove old values from the Session’s flash data.
  */
 public static function flush()
 {
     // Make sure the session is started
     s::start();
     // Retrieve the flash data
     $registry = s::get(self::$namespace);
     // Clean up registry
     if (!empty($registry)) {
         foreach ($registry as $key => $expiry) {
             $expiry++;
             // Remove all old values from the session
             if ($expiry > 1) {
                 s::remove($key);
                 unset($registry[$key]);
             } else {
                 $registry[$key] = $expiry;
             }
         }
         // Write registry back to session
         if (!empty($registry)) {
             s::set(self::$namespace, $registry);
         } else {
             s::remove(self::$namespace);
         }
     }
 }
開發者ID:buditanrim,項目名稱:kirby-comments,代碼行數:29,代碼來源:session.php

示例3: get

 public static function get($name)
 {
     $messages = s::get('messages');
     foreach ($messages as $key => $message) {
         if ($message->name == $name) {
             return $message->value;
         }
     }
     s::remove('messages');
 }
開發者ID:aoimedia,項目名稱:aurer-kirby,代碼行數:10,代碼來源:message.php

示例4: deconstruct

 /**
  * Deconstruct the order object
  *
  * @return void
  */
 public function deconstruct()
 {
     $this->emptyGuests();
     s::remove('order.comments');
     s::remove('order.couponCode');
 }
開發者ID:evendev,項目名稱:paintcrazy,代碼行數:11,代碼來源:CrazyEventOrder.php

示例5: testSessionRemove

 function testSessionRemove()
 {
     s::remove('key');
     $this->assertNull(s::get('key'));
 }
開發者ID:o-github-o,項目名稱:jQuery-Ajax-Upload,代碼行數:5,代碼來源:session.php

示例6: snippet

</textarea>
						<?php 
    echo $validator->field_error('message');
    ?>
					</div>
				</div>
				<div class="field field-submit">
					<input type="submit" name="submit" class="btn" value="Send" />
				</div>
			</form>
		<?php 
} else {
    ?>
			<div class="sent">
				<h2>Thanks for getting in touch.</h2>
				<p>I will try to get back you you as soon as possible.</p>
			</div>
		<?php 
}
?>
	</div>
</div>

<?php 
echo snippet('content-types/social');
?>

<?php 
echo snippet('footer');
s::remove('email_sent');
開發者ID:aoimedia,項目名稱:aurer-kirby,代碼行數:30,代碼來源:contact.php

示例7: __construct

 /**
  * Instantiate the singleton
  *
  * @return void
  */
 protected function __construct()
 {
     static::$data = s::get('flash', []);
     s::remove('flash');
 }
開發者ID:evendev,項目名稱:paintcrazy,代碼行數:10,代碼來源:Flash.php

示例8: reset

 public function reset()
 {
     return s::remove($this->id);
 }
開發者ID:nsteiner,項目名稱:kdoc,代碼行數:4,代碼來源:store.php

示例9: header

 if (count($_POST) > 0) {
     //store specific sanitized $_POST variables into resetData session variable
     s::set('resetData', r::postData(array('password', 'password2')));
     //store URI param variables into session variables
     s::set('username', $paramUsername);
     s::set('hash', $paramResetHash);
     //redirect to same page (POST/GET/REDIRECT PATTERN-like)
     header('HTTP/1.1 303 See Other');
     header('Location: ' . $page->url());
 } elseif (s::get('resetData')) {
     //store resetData session variable into $data
     $data = s::get('resetData');
     //remove session variables
     s::remove('resetData');
     s::remove('username');
     s::remove('hash');
     //define validation rules for $data
     $rules = array('password' => array('required', 'match' => c::get('password.length.regex')), 'password2' => array('required', 'same' => $data['password']));
     //define validation messages for $data
     $messages = array('password' => l('field.password.validaton.message'), 'password2' => l('field.password2.validaton.message'));
     //if validation is passed
     if (!($invalid = invalid(array_filter($data), $rules, $messages))) {
         //try to update user's account password
         $userUpdatedData = $user->update(array('password' => $data['password']));
         //if updating user's password was successful
         if ($userUpdatedData) {
             //set success message
             $success['Account'] = l('reset.success.update');
         } else {
             //add error: password update failed
             $invalid['Account'] = l('reset.fail.update');
開發者ID:alkaest2002,項目名稱:risky2,代碼行數:31,代碼來源:reset.php

示例10: logout

 public static function logout()
 {
     session_regenerate_id();
     s::remove('auth.created');
     s::remove('auth.updated');
     s::remove('auth.key');
     s::remove('auth.secret');
     s::remove('auth.username');
     s::remove('auth.ip');
     s::remove('auth.ua');
     cookie::remove('key');
 }
開發者ID:robinandersen,項目名稱:robin,代碼行數:12,代碼來源:user.php

示例11: reset

 public function reset()
 {
     if ($this->field) {
         return $this->store()->reset();
     } else {
         foreach (s::get() as $key => $value) {
             if (str::startsWith($key, $this->id)) {
                 s::remove($key);
             }
         }
     }
 }
開發者ID:irenehilber,項目名稱:kirby-base,代碼行數:12,代碼來源:structure.php

示例12: url

<?php

s::remove('cart');
snippet('header');
?>

<main id="paid" class="main black" role="main">

	<div class="text">
		<h1><?php 
echo $page->subtitle()->or($page->title());
?>
</h1>
		<a class="btn-white" href="<?php 
echo url('products');
?>
">Acheter à nouveau ?</a>
	</div>

</main>

<?php 
snippet('footer');
開發者ID:starckio,項目名稱:Cartkit,代碼行數:23,代碼來源:paid.php

示例13: strtoupper

}
s::set('country', $country);
// Set discount code from query string or user profile
if ($code = get('dc') or $user = site()->user() and $code = $user->discountcode()) {
    s::set('discountCode', strtoupper($code));
} else {
    if (get('dc') === '') {
        s::remove('discountCode');
    }
}
// Set gift certificate code from query string
if ($code = get('gc')) {
    s::set('giftCertificateCode', strtoupper($code));
} else {
    if (get('gc') === '') {
        s::remove('giftCertificateCode');
    }
}
/**
 * Helper function to format price
 */
function formatPrice($number)
{
    $symbol = page('shop')->currency_symbol();
    $currencyCode = page('shop')->currency_code();
    if (page('shop')->currency_position() == 'before') {
        return '<span property="priceCurrency" content="' . $currencyCode . '">' . $symbol . '</span> <span property="price" content="' . number_format((double) $number, 2, '.', '') . '">' . number_format((double) $number, 2, '.', '') . '</span>';
    } else {
        return number_format($number, 2, '.', '') . '&nbsp;' . $symbol;
    }
}
開發者ID:samnabi,項目名稱:shopkit,代碼行數:31,代碼來源:shopkit.php

示例14: header

 $user = null;
 $data = null;
 $invalid = null;
 $success = null;
 //if $_POST data is present
 if (count($_POST) > 0) {
     //store specific sanitized $_POST variables into registerData session variable
     s::set('registerData', r::postData(array('email', 'password', 'password2', 'session')));
     //redirect to same page (POST/GET/REDIRECT PATTERN-like)
     header('HTTP/1.1 303 See Other');
     header('Location: ' . $page->url());
 } elseif (s::get('registerData')) {
     //store registerData session variable into $data varaiable
     $data = s::get('registerData');
     //unset $registerData session variable
     s::remove('registerData');
     //define validation rules for $data
     $rules = array('email' => array('required', 'email'), 'password' => array('required', 'match' => c::get('password.length.regex')), 'password2' => array('required', 'same' => $data['password']), 'session' => array('required'));
     //define validation messages for $data
     $messages = array('email' => l('field.email.validation.message'), 'password' => l('field.password.validaton.message'), 'password2' => l('field.password2.validaton.message'), 'session' => l('field.session.validaton.message'));
     //if validation is passed
     if (!($invalid = invalid(array_filter($data), $rules, $messages))) {
         //compute user's username (based upon user's email)
         $computedUsername = Auth::computeUsername($data['email']);
         //**** USER DATA****************************************************************************
         //user's computed name
         $paramUsername = $computedUsername;
         //user's password (will be encrypted by KIRBY)
         $paramPassword = $data['password'];
         //user's email
         $paramEmail = $data['email'];
開發者ID:alkaest2002,項目名稱:risky2,代碼行數:31,代碼來源:register.php

示例15: site

<?php

// Check if user is coming from the cart page or from PayPal
s::start();
if (s::get('sendBack')) {
    // If coming from PayPal, kick them back to the cart
    s::remove('sendBack');
    go('shop/cart');
} else {
    s::set('sendBack', true);
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8" />
	<title><?php 
echo site()->title()->html();
?>
 | <?php 
echo page('shop/cart')->title();
?>
</title>
	<style>
		body { font-family: sans-serif; font-size: 2rem; text-align: center; }
		button { font-size: 1rem; padding: 1rem; }
	</style>
</head>
<body>
	<p><?php 
開發者ID:jenniferhail,項目名稱:kirbypine,代碼行數:31,代碼來源:cart.process.paypal.php


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