本文整理汇总了PHP中Magento\Framework\App\Request\Http::getFullActionName方法的典型用法代码示例。如果您正苦于以下问题:PHP Http::getFullActionName方法的具体用法?PHP Http::getFullActionName怎么用?PHP Http::getFullActionName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\App\Request\Http
的用法示例。
在下文中一共展示了Http::getFullActionName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* @param $observer
* @return $this
*/
public function execute(EventObserver $observer)
{
$menu = $observer->getMenu();
$tree = $menu->getTree();
$fullAction = $this->request->getFullActionName();
$selectedActions = ['gemtoo_blog_article_index', 'gemtoo_blog_article_view'];
$articleNodeId = 'articles';
$data = ['name' => __('Blog'), 'id' => $articleNodeId, 'url' => $this->articleUrl->getListUrl(), 'is_active' => in_array($fullAction, $selectedActions)];
$articlesNode = new Node($data, 'id', $tree, $menu);
$menu->addChild($articlesNode);
return $this;
}
示例2: testGetFullActionName
public function testGetFullActionName()
{
$this->_model = $this->getModel();
/* empty request */
$this->assertEquals('__', $this->_model->getFullActionName());
$this->_model->setRouteName('test')->setControllerName('controller')->setActionName('action');
$this->assertEquals('test/controller/action', $this->_model->getFullActionName('/'));
}
示例3: testGetFullActionName
public function testGetFullActionName()
{
$this->_model = new Request($this->_routerListMock, $this->_infoProcessorMock);
/* empty request */
$this->assertEquals('__', $this->_model->getFullActionName());
$this->_model->setRouteName('test')->setControllerName('controller')->setActionName('action');
$this->assertEquals('test/controller/action', $this->_model->getFullActionName('/'));
}
示例4: renderResult
/**
* Render current layout
*
* @param ResponseInterface $response
* @return $this
*/
public function renderResult(ResponseInterface $response)
{
\Magento\Framework\Profiler::start('LAYOUT');
\Magento\Framework\Profiler::start('layout_render');
$this->applyHttpHeaders($response);
$this->render($response);
$this->eventManager->dispatch('layout_render_before');
$this->eventManager->dispatch('layout_render_before_' . $this->request->getFullActionName());
\Magento\Framework\Profiler::stop('layout_render');
\Magento\Framework\Profiler::stop('LAYOUT');
return $this;
}
示例5: generateLayoutBlocks
/**
* Generate layout blocks
*
* @return $this
*/
protected function generateLayoutBlocks()
{
$this->beforeGenerateBlock();
Profiler::start('LAYOUT');
/* dispatch event for adding xml layout elements */
$this->eventManager->dispatch('layout_generate_blocks_before', ['full_action_name' => $this->request->getFullActionName(), 'layout' => $this->layout]);
Profiler::start('layout_generate_blocks');
/* generate blocks from xml layout */
$this->layout->generateElements();
Profiler::stop('layout_generate_blocks');
$this->eventManager->dispatch('layout_generate_blocks_after', ['full_action_name' => $this->request->getFullActionName(), 'layout' => $this->layout]);
Profiler::stop('LAYOUT');
$this->afterGenerateBlock();
return $this;
}