本文整理匯總了PHP中CakeSession::del方法的典型用法代碼示例。如果您正苦於以下問題:PHP CakeSession::del方法的具體用法?PHP CakeSession::del怎麽用?PHP CakeSession::del使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CakeSession
的用法示例。
在下文中一共展示了CakeSession::del方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: flash
/**
* Used to render the message set in Controller::Session::setFlash()
*
* In your view: $session->flash('somekey');
* Will default to flash if no param is passed
*
* @param string $key The [Message.]key you are rendering in the view.
* @return string Will echo the value if $key is set, or false if not set.
* @access public
*/
function flash($key = 'flash')
{
if ($this->__active === true && $this->__start()) {
if (parent::check('Message.' . $key)) {
$flash = parent::read('Message.' . $key);
if ($flash['layout'] == 'default') {
if (!empty($flash['params']['class'])) {
$class = $flash['params']['class'];
} else {
$class = 'message';
}
$out = '<div id="' . $key . 'Message" class="' . $class . '">' . $flash['message'] . '</div>';
} elseif ($flash['layout'] == '' || $flash['layout'] == null) {
$out = $flash['message'];
} else {
$view =& ClassRegistry::getObject('view');
list($tmpVars, $tmpTitle) = array($view->viewVars, $view->pageTitle);
list($view->viewVars, $view->pageTitle) = array($flash['params'], '');
$out = $view->renderLayout($flash['message'], $flash['layout']);
list($view->viewVars, $view->pageTitle) = array($tmpVars, $tmpTitle);
}
echo $out;
parent::del('Message.' . $key);
return true;
}
}
return false;
}
示例2: del
/**
* Used to delete a session variable.
*
* In your controller: $this->Session->del('Controller.sessKey');
*
* @param string $name the name of the session key you want to delete
* @return boolean true is session variable is set and can be deleted, false is variable was not set.
* @access public
*/
function del($name)
{
if ($this->__active === true) {
$this->__start();
return parent::del($name);
}
return false;
}
示例3: del
/**
* @deprecated use delete
*/
function del($name)
{
trigger_error('Deprecated method, use SessionComponent::delete instead', E_USER_WARNING);
if ($this->__active === true) {
$this->__start();
return parent::del($name);
}
return false;
}