-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPage.php
32 lines (25 loc) · 975 Bytes
/
Page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
namespace MageSuite\SeoLinkMasking\Helper;
class Page
{
const SEARCH_RESULT_PAGE_FULL_ACTION_NAME = 'catalogsearch_result_index';
const BRAND_PAGE_FULL_ACTION_NAME = 'brands_index_index';
const AJAX_FILTER_FULL_ACTION_NAME = 'catalog_navigation_filter_ajax';
protected \Magento\Framework\App\Request\Http $request;
public function __construct(\Magento\Framework\App\Request\Http $request)
{
$this->request = $request;
}
public function isSearchResultPage(): bool
{
return $this->request->getFullActionName() == self::SEARCH_RESULT_PAGE_FULL_ACTION_NAME;
}
public function isBrandsIndexPage(): bool
{
return $this->request->getFullActionName() == self::BRAND_PAGE_FULL_ACTION_NAME;
}
public function isSearchResultPageAjaxFilterCall(): bool
{
return !$this->request->getParam('cat') && ($this->request->getFullActionName() == self::AJAX_FILTER_FULL_ACTION_NAME);
}
}