本文整理汇总了PHP中Zend_Controller_Request_Abstract::getCookie方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Request_Abstract::getCookie方法的具体用法?PHP Zend_Controller_Request_Abstract::getCookie怎么用?PHP Zend_Controller_Request_Abstract::getCookie使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Controller_Request_Abstract
的用法示例。
在下文中一共展示了Zend_Controller_Request_Abstract::getCookie方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPanel
/**
* Gets content panel for the Debug Bar
*
* @return string
*/
public function getPanel()
{
$this->request = \Zend_Controller_Front::getInstance()->getRequest();
$viewRenderer = \Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
if ($viewRenderer->view && method_exists($viewRenderer->view, 'getVars')) {
$viewVars = $this->cleanData($viewRenderer->view->getVars());
} else {
$viewVars = "No 'getVars()' method in view class";
}
$vars = '<div style="width:50%;float:left;">';
$vars .= '<h4>View variables</h4>' . '<div id="ZFDebug_vars" style="margin-left:-22px">' . $viewVars . '</div>';
$vars .= '</div><div style="width:45%;float:left;">';
$vars .= '<h4>Request parameters</h4>' . '<div id="ZFDebug_requests" style="margin-left:-22px">' . $this->cleanData($this->request->getParams()) . '</div>';
if ($this->request->isPost()) {
$vars .= '<h4>Post variables</h4>' . '<div id="ZFDebug_post" style="margin-left:-22px">' . $this->cleanData($this->request->getPost()) . '</div>';
}
$vars .= '<h4>Constants</h4>';
$constants = get_defined_constants(true);
ksort($constants['user']);
$vars .= '<div id="ZFDebug_constants" style="margin-left:-22px">' . $this->cleanData($constants['user']) . '</div>';
$registry = \Zend_Registry::getInstance();
$vars .= '<h4>Zend Registry</h4>';
$registry->ksort();
$vars .= '<div id="ZFDebug_registry" style="margin-left:-22px">' . $this->cleanData($registry) . '</div>';
$cookies = $this->request->getCookie();
$vars .= '<h4>Cookies</h4>' . '<div id="ZFDebug_cookie" style="margin-left:-22px">' . $this->cleanData($cookies) . '</div>';
$vars .= '</div><div style="clear:both"> </div>';
return $vars;
}
示例2: getPanel
/**
* Gets content panel for the Debugbar
*
* @return string
*/
public function getPanel()
{
$this->_request = Zend_Controller_Front::getInstance()->getRequest();
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
$viewVars = $viewRenderer->view->getVars();
$vars = '';
if ($this->_request->isPost()) {
$vars .= '<h4>$_POST</h4>' . '<div id="Centurion_ZFDebug_post">' . $this->_cleanData($this->_request->getPost()) . '</div>';
}
$vars .= '<h4>$_COOKIE</h4>' . '<div id="Centurion_ZFDebug_cookie">' . $this->_cleanData($this->_request->getCookie()) . '</div>' . '<h4>Request</h4>' . '<div id="Centurion_ZFDebug_requests">' . $this->_cleanData($this->_request->getParams()) . '</div>' . '<h4>View vars</h4>' . '<div id="Centurion_ZFDebug_vars">' . $this->_cleanData($viewVars) . '</div>';
return $vars;
}
示例3: getPanel
/**
* Gets content panel for the Debugbar
*
* @return string
*/
public function getPanel()
{
$this->_request = Zend_Controller_Front::getInstance()->getRequest();
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
$viewVars = $viewRenderer->view->getVars();
foreach ($viewVars as $k => $v) {
$this->message->addRow(array($k . " - View", self::_cleanData($v)));
}
foreach ($this->_request->getParams() as $k => $v) {
$this->message->addRow(array($k . " - Parameter", self::_cleanData($v)));
}
foreach ($this->_request->getCookie() as $k => $v) {
$this->message->addRow(array($k . " - Cookie", self::_cleanData($v)));
}
}
示例4: getPanel
/**
* Gets content panel for the Debugbar
*
* @return string
*/
public function getPanel()
{
$this->_request = Zend_Controller_Front::getInstance()->getRequest();
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
if ($viewRenderer->view && method_exists($viewRenderer->view, 'getVars')) {
$viewVars = $this->_cleanData($viewRenderer->view->getVars());
} else {
$viewVars = "Pas de méthode 'getVars()' dans l\\'objet vue";
}
$vars = '';
if ($this->_request->isPost()) {
$vars .= '<h4>Superglobale $_POST</h4>' . '<div id="ZFDebug_post">' . $this->_cleanData($this->_request->getPost()) . '</div>';
}
$vars .= '<h4>Superglobale $_COOKIE</h4>' . '<div id="ZFDebug_cookie">' . $this->_cleanData($this->_request->getCookie()) . '</div>' . '<h4>Paramètres de l\'objet Request</h4>' . '<div id="ZFDebug_requests">' . $this->_cleanData($this->_request->getParams()) . '</div>' . '<h4>Variables de vue (Zend_View)</h4>' . '<div id="ZFDebug_vars">' . $viewVars . '</div>';
return $vars;
}
示例5: getPanel
/**
* Gets content panel for the Debugbar
*
* @return string
*/
public function getPanel()
{
$this->_request = Zend_Controller_Front::getInstance()->getRequest();
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
if ($viewRenderer->view && method_exists($viewRenderer->view, 'getVars')) {
$viewVars = $this->_cleanData($viewRenderer->view->getVars());
} else {
$viewVars = "No 'getVars()' method in view class";
}
// $front = Zend_Controller_Front::getInstance();
$vars = '';
if ($this->_request->isPost()) {
$vars .= '<h4>$_POST</h4>' . '<div id="ZFDebug_post">' . $this->_cleanData($this->_request->getPost()) . '</div>';
}
$vars .= '<h4>$_COOKIE</h4>' . '<div id="ZFDebug_cookie">' . $this->_cleanData($this->_request->getCookie()) . '</div>' . '<h4>Request</h4>' . '<div id="ZFDebug_requests">' . $this->_cleanData($this->_request->getParams()) . '</div>' . '<h4>View vars</h4>' . '<div id="ZFDebug_vars">' . $viewVars . '</div>';
return $vars;
}
示例6: routeShutdown
/**
* Finish routing request
* Then change language want to translate and keep track lastest language want translate
*
* @param type Zend_Controller_Request_Abstract $request
* @return void
*/
public function routeShutdown(Zend_Controller_Request_Abstract $request)
{
$rememberLanguage = $request->getCookie('lang');
$languageWantTranslateTo = $request->getParam('lang', $rememberLanguage);
$notFoundRequestChangingLanguage = empty($languageWantTranslateTo);
if ($notFoundRequestChangingLanguage || $this->systemNotSupported($languageWantTranslateTo) || $this->notFoundSharedTranslator()) {
return;
}
$this->changeLanguageUsedInApplication($languageWantTranslateTo);
$this->remember($languageWantTranslateTo);
}
示例7: preDispatch
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$req = array('GET' => $request->getQuery(), 'POST' => $request->getPost(), 'COOKIE' => $request->getCookie(), 'PARAMS' => $request->getUserParams());
$init = IDS_Init::init(APPLICATION_PATH . '/configs/phpids.ini');
$ids = new IDS_Monitor($req, $init);
$result = $ids->run();
if (!$result->isEmpty()) {
$compositeLog = new IDS_Log_Composite();
$compositeLog->addLogger(IDS_Log_File::getInstance($init));
$compositeLog->execute($result);
}
}
示例8: preDispatch
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$lang = $request->getQuery('lang');
if ($lang) {
setcookie("syj_lang", $lang, 0, "", "", false, true);
} else {
$lang = $request->getCookie('syj_lang');
}
if (!$lang) {
return;
}
$translator = Zend_Registry::get('Zend_Translate');
$adapter = $translator->getAdapter();
if (!$adapter->isAvailable($lang)) {
return;
}
$adapter->setLocale($lang);
}
示例9: get
/**
* Get a specific cookie from the request.
*
* @param \Zend_Controller_Request_Abstract $request
* @param string $name
* @param mixed $default
* @return mixed Cookie value
*/
public static function get(\Zend_Controller_Request_Abstract $request, $name, $default = null)
{
return $request->getCookie($name, $default);
}