public function DrupalGatherContentClient::getTemplatesOptionArray in GatherContent 8.5
Same name and namespace in other branches
- 8.4 src/DrupalGatherContentClient.php \Drupal\gathercontent\DrupalGatherContentClient::getTemplatesOptionArray()
Returns a formatted array with the template ID's as a key.
Parameters
int $projectId: Project ID.
Return value
array Return array.
File
- src/
DrupalGatherContentClient.php, line 86
Class
- DrupalGatherContentClient
- Extends the GatherContentClient class with Drupal specific functionality.
Namespace
Drupal\gathercontentCode
public function getTemplatesOptionArray($projectId) {
$formatted = [];
$templates = $this
->templatesGet($projectId);
foreach ($templates['data'] as $template) {
$formatted[$template->id] = $template->name;
}
return $formatted;
}