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


PHP CM_Params::has方法代碼示例

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


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

示例1: 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);
 }
開發者ID:NicolasSchmutz,項目名稱:cm,代碼行數:7,代碼來源:Set.php

示例2: prepare

 public function prepare(CM_Params $renderParams, CM_Frontend_Environment $environment, CM_Frontend_ViewResponse $viewResponse)
 {
     $viewResponse->set('autocorrect', $renderParams->has('autocorrect') ? $renderParams->getString('autocorrect') : null);
     $viewResponse->set('autocapitalize', $renderParams->has('autocapitalize') ? $renderParams->getString('autocapitalize') : null);
     $viewResponse->set('tabindex', $renderParams->has('tabindex') ? $renderParams->getInt('tabindex') : null);
     $viewResponse->set('class', $renderParams->has('class') ? $renderParams->getString('class') : null);
     $viewResponse->set('placeholder', $renderParams->has('placeholder') ? $renderParams->getString('placeholder') : null);
 }
開發者ID:NicolasSchmutz,項目名稱:cm,代碼行數:8,代碼來源:Text.php

示例3: testAllowedMissingField

 public function testAllowedMissingField()
 {
     $form = new CM_Form_MockForm();
     $action = new CM_FormAction_MockForm_TestExampleAction($form);
     $data = array('must_check' => 'checked', 'text' => 'foo');
     $response = $this->getResponseFormAction($action, $data);
     $this->assertFormResponseSuccess($response);
     $this->assertFalse(self::$formActionData->has('color'));
 }
開發者ID:cargomedia,項目名稱:cm,代碼行數:9,代碼來源:AbstractTest.php

示例4: _execute

 protected function _execute(CM_Params $params)
 {
     CM_Service_Manager::getInstance()->getMailer()->send($params->getMailMessage('message'));
     if ($params->has('recipient') && $params->has('mailType')) {
         $recipient = $params->getUser('recipient');
         $mailType = $params->getInt('mailType');
         $action = new CM_Action_Email(CM_Action_Abstract::SEND, $recipient, $mailType);
         $action->prepare($recipient);
         $action->notify($recipient);
     }
 }
開發者ID:cargomedia,項目名稱:cm,代碼行數:11,代碼來源:SendJob.php

示例5: prepare

 public function prepare(CM_Params $renderParams, CM_Frontend_Environment $environment, CM_Frontend_ViewResponse $viewResponse)
 {
     $display = $renderParams->get('display', self::DISPLAY_CHECKBOX);
     if (!in_array($display, array(self::DISPLAY_CHECKBOX, self::DISPLAY_SWITCH))) {
         throw new CM_Exception_InvalidParam('Display needs to be either `checkbox` or `switch`');
     }
     $viewResponse->set('display', $display);
     $viewResponse->set('tabindex', $renderParams->has('tabindex') ? $renderParams->getInt('tabindex') : null);
     $viewResponse->set('class', $renderParams->has('class') ? $renderParams->getString('class') : null);
     $viewResponse->set('checked', $this->getValue() ? 'checked' : null);
     $viewResponse->set('text', $renderParams->has('text') ? $renderParams->getString('text') : null);
 }
開發者ID:cargomedia,項目名稱:cm,代碼行數:12,代碼來源:Boolean.php

示例6: ajax_flushLog

 public function ajax_flushLog(CM_Params $params, CM_Frontend_JavascriptContainer $handler, CM_Http_Response_View_Ajax $response)
 {
     if (!$this->_getAllowedFlush($response->getRender()->getEnvironment())) {
         throw new CM_Exception_NotAllowed();
     }
     $level = $params->has('level') ? $params->getInt('level') : null;
     $levelList = $level ? [$level] : null;
     $type = $params->has('type') ? $params->getInt('type') : null;
     $logList = new CM_Paging_Log($levelList, $type);
     $logList->flush();
     $response->reloadComponent();
 }
開發者ID:cargomedia,項目名稱:cm,代碼行數:12,代碼來源:LogList.php

示例7: prepare

 public function prepare(CM_Params $renderParams, CM_Frontend_Environment $environment, CM_Frontend_ViewResponse $viewResponse)
 {
     $text = $renderParams->has('text') ? $renderParams->getString('text') : null;
     $buttonTheme = $this->_params->getString('buttonTheme', 'default');
     $skipPreviews = $this->_params->getBoolean('skipPreviews', false);
     $viewResponse->set('text', $text);
     $viewResponse->set('buttonTheme', $buttonTheme);
     if ($skipPreviews) {
         $viewResponse->setDataAttributes(['skip-previews' => '']);
     }
 }
開發者ID:cargomedia,項目名稱:cm,代碼行數:11,代碼來源:File.php

示例8: 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);
     $years = range($this->_yearFirst, $this->_yearLast);
     $months = range(1, 12);
     $days = range(1, 31);
     $viewResponse->set('years', array_combine($years, $years));
     $viewResponse->set('months', array_combine($months, $months));
     $viewResponse->set('days', array_combine($days, $days));
     /** @var DateTime|null $value */
     $value = $this->getValue();
     $year = $month = $day = null;
     if (null !== $value) {
         $value->setTimezone($this->_getTimeZone($environment));
         $year = $value->format('Y');
         $month = $value->format('n');
         $day = $value->format('j');
     }
     $viewResponse->set('yy', $year);
     $viewResponse->set('mm', $month);
     $viewResponse->set('dd', $day);
     $viewResponse->set('placeholderStart', $renderParams->has('placeholderStart') ? $renderParams->getString('placeholderStart') : null);
     $viewResponse->set('placeholderEnd', $renderParams->has('placeholderEnd') ? $renderParams->getString('placeholderEnd') : null);
 }
開發者ID:cargomedia,項目名稱:cm,代碼行數:24,代碼來源:DateTimeInterval.php

示例9: testHas

 public function testHas()
 {
     $params = new CM_Params(array('1' => 0, '2' => 'ababa', '3' => new stdClass(), '4' => null, '5' => false));
     $this->assertTrue($params->has('1'));
     $this->assertTrue($params->has('2'));
     $this->assertTrue($params->has('3'));
     $this->assertFalse($params->has('4'));
     $this->assertTrue($params->has('5'));
     $this->assertFalse($params->has('6'));
 }
開發者ID:cargomedia,項目名稱:cm,代碼行數:10,代碼來源:ParamsTest.php

示例10: 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);
 }
開發者ID:aladin1394,項目名稱:CM,代碼行數:16,代碼來源:Example.php

示例11: 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('placeholder', $renderParams->has('placeholder') ? $renderParams->getString('placeholder') : null);
 }
開發者ID:aladin1394,項目名稱:CM,代碼行數:5,代碼來源:Suggest.php


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