本文整理匯總了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'));
}