本文整理汇总了PHP中CM_Params::get方法的典型用法代码示例。如果您正苦于以下问题:PHP CM_Params::get方法的具体用法?PHP CM_Params::get怎么用?PHP CM_Params::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CM_Params
的用法示例。
在下文中一共展示了CM_Params::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: testGetWithInvalidEncodedData
public function testGetWithInvalidEncodedData()
{
$params = new CM_Params(['foo' => ['_class' => 'Some_Nonexistent_Class', '_id' => 123]]);
$this->assertSame(['_class' => 'Some_Nonexistent_Class', '_id' => 123], $params->get('foo'));
}
示例3: ajax_validate
public function ajax_validate(CM_Params $params, CM_Frontend_JavascriptContainer_View $handler, CM_Http_Response_View_Ajax $response)
{
$environment = $response->getRender()->getEnvironment();
$userInput = $params->get('userInput');
$this->validate($environment, $userInput);
}
示例4: prepare
public function prepare(CM_Params $renderParams, CM_Frontend_Environment $environment, CM_Frontend_ViewResponse $viewResponse)
{
$viewResponse->set('itemValue', $renderParams->get('item'));
}