protected function Vocabulary::_splitRouteArg in Sitemap 2.0.x
Same name and namespace in other branches
- 8.2 src/Plugin/Sitemap/Vocabulary.php \Drupal\sitemap\Plugin\Sitemap\Vocabulary::_splitRouteArg()
Helper function to split the route|arg pattern.
Parameters
string $string:
Return value
array
2 calls to Vocabulary::_splitRouteArg()
- Vocabulary::buildLink in src/
Plugin/ Sitemap/ Vocabulary.php - Build the URL given a route|arg pattern.
- Vocabulary::validateCustomRoute in src/
Plugin/ Sitemap/ Vocabulary.php - Validate the route and argument provided. @TODO Implement for form_save and config import.
File
- src/
Plugin/ Sitemap/ Vocabulary.php, line 465
Class
- Vocabulary
- Provides a sitemap for an taxonomy vocabulary.
Namespace
Drupal\sitemap\Plugin\SitemapCode
protected function _splitRouteArg($string) {
$return = [];
if ($string) {
$arr = explode('|', $string);
if (count($arr) == 2) {
$return['route'] = $arr[0];
$return['arg'] = $arr[1];
}
}
return $return;
}