本文整理匯總了PHP中Magento\Framework\App\RequestInterface::setParam方法的典型用法代碼示例。如果您正苦於以下問題:PHP RequestInterface::setParam方法的具體用法?PHP RequestInterface::setParam怎麽用?PHP RequestInterface::setParam使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Framework\App\RequestInterface
的用法示例。
在下文中一共展示了RequestInterface::setParam方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dispatch
/**
* Check if current section is found and is allowed
*
* @param \Magento\Framework\App\RequestInterface $request
* @return \Magento\Framework\App\ResponseInterface
*/
public function dispatch(\Magento\Framework\App\RequestInterface $request)
{
if (!$request->getParam('section')) {
$request->setParam('section', $this->_configStructure->getFirstSection()->getId());
}
return parent::dispatch($request);
}
示例2: dispatch
/**
* Check if current section is found and is allowed
*
* @param \Magento\Framework\App\RequestInterface $request
* @return \Magento\Framework\App\ResponseInterface
*/
public function dispatch(\Magento\Framework\App\RequestInterface $request)
{
$section = null;
if (!$request->getParam('section')) {
$section = $this->_configStructure->getFirstSection();
$request->setParam('section', $section->getId());
} else {
$this->_isSectionAllowed($request->getParam('section'));
}
return parent::dispatch($request);
}
示例3: _performLogin
/**
* Performs login, if user submitted login form
*
* @param \Magento\Framework\App\RequestInterface $request
* @return bool
*/
protected function _performLogin(\Magento\Framework\App\RequestInterface $request)
{
$outputValue = true;
$postLogin = $request->getPost('login');
$username = isset($postLogin['username']) ? $postLogin['username'] : '';
$password = isset($postLogin['password']) ? $postLogin['password'] : '';
$request->setPostValue('login', null);
try {
$this->_auth->login($username, $password);
} catch (AuthenticationException $e) {
if (!$request->getParam('messageSent')) {
$this->messageManager->addError($e->getMessage());
$request->setParam('messageSent', true);
$outputValue = false;
}
}
return $outputValue;
}
示例4: testTextTranslationMode
/**
* @dataProvider textTranslationMode
*/
public function testTextTranslationMode($mode)
{
$this->_request->setParam('translation_mode', $mode);
$this->_helperData->setTranslationMode($this->_request);
$this->assertEquals($mode, $this->_helperData->getTranslationMode());
}