本文整理匯總了PHP中CM_Params::getBoolean方法的典型用法代碼示例。如果您正苦於以下問題:PHP CM_Params::getBoolean方法的具體用法?PHP CM_Params::getBoolean怎麽用?PHP CM_Params::getBoolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CM_Params
的用法示例。
在下文中一共展示了CM_Params::getBoolean方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: prepare
public function prepare(CM_Params $renderParams, CM_Frontend_Environment $environment, CM_Frontend_ViewResponse $viewResponse)
{
$text = $this->getParams()->has('text') ? $renderParams->getString('text') : null;
$skipDropZone = $renderParams->getBoolean('skipDropZone', false);
$viewResponse->set('text', $text);
$viewResponse->set('skipDropZone', $skipDropZone);
}
示例2: prepare
public function prepare(CM_Params $renderParams, CM_Frontend_Environment $environment, CM_Frontend_ViewResponse $viewResponse)
{
$viewResponse->set('class', $renderParams->has('class') ? $renderParams->getString('class') : null);
$viewResponse->set('optionList', $this->_getOptionList());
$viewResponse->set('translate', $renderParams->getBoolean('translate', $this->_translate) || $renderParams->has('translatePrefix'));
$viewResponse->set('translatePrefix', $renderParams->has('translatePrefix') ? $renderParams->getString('translatePrefix') : null);
}
示例3: ajax_clearCache
public function ajax_clearCache(CM_Params $params, CM_Frontend_JavascriptContainer_View $handler, CM_Http_Response_View_Ajax $response)
{
$cachesCleared = array();
if ($params->getBoolean('CM_Cache_Storage_Memcache', false)) {
$cache = new CM_Cache_Storage_Memcache();
$cache->flush();
$cachesCleared[] = 'CM_Cache_Storage_Memcache';
}
if ($params->getBoolean('CM_Cache_Storage_Apc', false)) {
$cache = new CM_Cache_Storage_Apc();
$cache->flush();
$cachesCleared[] = 'CM_Cache_Storage_Apc';
}
if ($params->getBoolean('CM_Cache_Storage_File', false)) {
$cache = new CM_Cache_Storage_File();
$cache->flush();
$cachesCleared[] = 'CM_Cache_Storage_File';
}
$handler->message('Cleared: ' . implode(', ', $cachesCleared));
}
示例4: ajax_error
public function ajax_error(CM_Params $params, CM_Frontend_JavascriptContainer_View $handler, CM_Http_Response_View_Ajax $response)
{
$status = $params->getInt('status', 200);
$message = $params->has('text') ? $params->getString('text') : null;
$messagePublic = $params->getBoolean('public', false) ? $message : null;
if (in_array($status, array(500, 599), true)) {
$response->addHeaderRaw('HTTP/1.1 ' . $status . ' Internal Server Error');
$response->sendHeaders();
exit($message);
}
$exception = $params->getString('exception');
if (!in_array($exception, array('CM_Exception', 'CM_Exception_AuthRequired'), true)) {
$exception = 'CM_Exception';
}
throw new $exception($message, $messagePublic);
}