You are here

protected function SimplesitemapCustomLinksForm::customLinksToString in Simple XML sitemap 8.3

Same name and namespace in other branches
  1. 8.2 src/Form/SimplesitemapCustomLinksForm.php \Drupal\simple_sitemap\Form\SimplesitemapCustomLinksForm::customLinksToString()

Parameters

array $links:

Return value

string

1 call to SimplesitemapCustomLinksForm::customLinksToString()
SimplesitemapCustomLinksForm::buildForm in src/Form/SimplesitemapCustomLinksForm.php
Form constructor.

File

src/Form/SimplesitemapCustomLinksForm.php, line 215

Class

SimplesitemapCustomLinksForm
Class SimplesitemapCustomLinksForm @package Drupal\simple_sitemap\Form

Namespace

Drupal\simple_sitemap\Form

Code

protected function customLinksToString(array $links) {
  $setting_string = '';
  foreach ($links as $custom_link) {
    $setting_string .= $custom_link['path'];
    $setting_string .= isset($custom_link['priority']) ? ' ' . $this->formHelper
      ->formatPriority($custom_link['priority']) : '';
    $setting_string .= isset($custom_link['changefreq']) ? ' ' . $custom_link['changefreq'] : '';
    $setting_string .= "\r\n";
  }
  return $setting_string;
}