trait CsvToArrayTrait in TagCloud 8
Same name and namespace in other branches
- 2.0.x src/Controller/CsvToArrayTrait.php \Drupal\tagclouds\Controller\CsvToArrayTrait
- 1.0.x src/Controller/CsvToArrayTrait.php \Drupal\tagclouds\Controller\CsvToArrayTrait
Provides method to convert cvs list of vocabulary id an to array.
Hierarchy
- trait \Drupal\tagclouds\Controller\CsvToArrayTrait
1 file declares its use of CsvToArrayTrait
- TagcloudsPageChunk.php in src/
Controller/ TagcloudsPageChunk.php
File
- src/
Controller/ CsvToArrayTrait.php, line 8
Namespace
Drupal\tagclouds\ControllerView source
trait CsvToArrayTrait {
/**
* Returns and array of ids when given a comma separated string of ids.
*
* @param string $strings
* The string of ids eg "tag1, tag2".
*
* @return array
* An array of ids.
*/
protected function csvToArray($strings) {
return !empty($strings) ? explode(',', $strings) : [];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CsvToArrayTrait:: |
protected | function | Returns and array of ids when given a comma separated string of ids. |