public function ExifSettingsController::createPhotographyVocabulary in Exif 8
Same name and namespace in other branches
- 8.2 src/Controller/ExifSettingsController.php \Drupal\exif\Controller\ExifSettingsController::createPhotographyVocabulary()
Create a vocabulary "photographies'metadata".
Use by routing.yml.
1 string reference to 'ExifSettingsController::createPhotographyVocabulary'
File
- src/
Controller/ ExifSettingsController.php, line 76
Class
- ExifSettingsController
- Class ExifSettingsController manage action of settings pages.
Namespace
Drupal\exif\ControllerCode
public function createPhotographyVocabulary() {
$values = [
"name" => "photographs metadata",
"vid" => "photographs_metadata",
"description" => "information related to photographs",
];
$voc = Vocabulary::load("photographs_metadata");
if (!$voc) {
Vocabulary::create($values)
->save();
$message = $this
->t('The vocabulary photography has been created');
}
else {
$message = $this
->t('The vocabulary photography is already created. nothing to do');
}
drupal_set_message($message);
$response = new RedirectResponse('/admin/config/media/exif/helper');
$response
->send();
exit;
}