本文整理汇总了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());
}