indexPage() публичный статический Метод

Index a page
public static indexPage ( array $arrData ) : boolean
$arrData array The data array
Результат boolean True if a new record was created
Пример #1
0
 /**
  * Index a page if applicable
  *
  * @param Response $objResponse
  */
 public static function indexPageIfApplicable(Response $objResponse)
 {
     global $objPage;
     if ($objPage === null) {
         return;
     }
     // Index page if searching is allowed and there is no back end user
     if (\Config::get('enableSearch') && $objPage->type == 'regular' && !BE_USER_LOGGED_IN && !$objPage->noSearch) {
         // Index protected pages if enabled
         if (\Config::get('indexProtected') || !FE_USER_LOGGED_IN && !$objPage->protected) {
             $blnIndex = true;
             // Do not index the page if certain parameters are set
             foreach (array_keys($_GET) as $key) {
                 if (in_array($key, $GLOBALS['TL_NOINDEX_KEYS']) || strncmp($key, 'page_', 5) === 0) {
                     $blnIndex = false;
                     break;
                 }
             }
             if ($blnIndex) {
                 $arrData = array('url' => \Environment::get('base') . \Environment::get('relativeRequest'), 'content' => $objResponse->getContent(), 'title' => $objPage->pageTitle ?: $objPage->title, 'protected' => $objPage->protected ? '1' : '', 'groups' => $objPage->groups, 'pid' => $objPage->id, 'language' => $objPage->language);
                 \Search::indexPage($arrData);
             }
         }
     }
 }