You are here

public function MonthDate::__toString in Views XML Backend 8

Generates an XPath argument string.

Return value

string The XPath argument string.

Overrides Date::__toString

File

src/Plugin/views/argument/MonthDate.php, line 56
Contains \Drupal\views_xml_backend\Plugin\views\argument\MonthDate.

Class

MonthDate
Argument handler for a month (MM).

Namespace

Drupal\views_xml_backend\Plugin\views\argument

Code

public function __toString() {
  $xpath = $this->options['xpath_selector'];
  $value = Xpath::escapeXpathString(str_pad((int) $this
    ->getValue(), 2, '0', STR_PAD_LEFT));
  $format = Xpath::escapeXpathString($this->argFormat);
  return "php:functionString('views_xml_backend_format_value', {$xpath}, {$format}) = {$value}";
}