예제 #1
0
 /**
  * @return $this
  * @throws \Magento\Framework\Exception\LocalizedException
  */
 protected function _prepareLayout()
 {
     if ($this->hasSubPhrases()) {
         $title = __("Search result for: '%1'", implode(" ", $this->queries));
         $this->pageConfig->getTitle()->set($title);
         // add Home breadcrumb
         $breadcrumbs = $this->getLayout()->getBlock('breadcrumbs');
         if ($breadcrumbs) {
             $breadcrumbs->addCrumb('home', ['label' => __('Home'), 'title' => __('Go to Home Page'), 'link' => $this->_storeManager->getStore()->getBaseUrl()])->addCrumb('search', ['label' => $title, 'title' => $title]);
         }
         return $this;
     }
     return parent::_prepareLayout();
 }