当前位置: 首页>>代码示例>>PHP>>正文


PHP CM_Params::getInt方法代码示例

本文整理汇总了PHP中CM_Params::getInt方法的典型用法代码示例。如果您正苦于以下问题:PHP CM_Params::getInt方法的具体用法?PHP CM_Params::getInt怎么用?PHP CM_Params::getInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CM_Params的用法示例。


在下文中一共展示了CM_Params::getInt方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _execute

 protected function _execute(CM_Params $params)
 {
     $id = $params->getInt('id');
     $class = $params->getInt('class');
     $values = $params->getArray('values');
     $svm = new CM_SVM_Model($id);
     $svm->addTraining($class, $values);
 }
开发者ID:cargomedia,项目名称:cm,代码行数:8,代码来源:AddTrainingJob.php

示例2: 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

示例3: testGetInt

 public function testGetInt()
 {
     $number1 = 12345678;
     $number2 = '12345678';
     $number3 = 'foo';
     $params = new CM_Params(array('number1' => $number1, 'number2' => CM_Params::encode($number2), 'number3' => $number3));
     $this->assertEquals($number1, $params->getInt('number1'));
     $this->assertEquals($number2, $params->getInt('number2'));
     try {
         $params->getInt('number3');
         $this->fail('invalid param. should not exist');
     } catch (CM_Exception_InvalidParam $e) {
         $this->assertTrue(true);
     }
     $this->assertEquals(4, $params->getInt('number4', 4));
 }
开发者ID:cargomedia,项目名称:cm,代码行数:16,代码来源:ParamsTest.php

示例4: _execute

 protected function _execute(CM_Params $params)
 {
     $id = $params->getInt('id');
     $values = $params->getArray('values');
     $svm = new CM_SVM_Model($id);
     return $svm->predict($values);
 }
开发者ID:cargomedia,项目名称:cm,代码行数:7,代码来源:PredictJob.php

示例5: 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

示例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();
     }
     $type = $params->getInt('type');
     $logList = CM_Paging_Log_Abstract::factory($type);
     $logList->flush();
     $response->reloadComponent();
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:10,代码来源:LogList.php

示例7: _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

示例8: 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

示例9: ajax_ping

 public function ajax_ping(CM_Params $params, CM_Frontend_JavascriptContainer_View $handler, CM_Http_Response_View_Ajax $response)
 {
     $number = $params->getInt('number');
     self::stream($response->getViewer(true), 'ping', array("number" => $number, "message" => 'pong'));
 }
开发者ID:cargomedia,项目名称:cm,代码行数:5,代码来源:Example.php

示例10: _execute

 protected function _execute(CM_Params $params)
 {
     CM_EventHandler_EventHandlerTest::$_counter += $params->getInt('a');
 }
开发者ID:cargomedia,项目名称:cm,代码行数:4,代码来源:EventHandlerTest.php


注:本文中的CM_Params::getInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。