本文整理汇总了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);
}