protected function DevelGenerateBase::setMessage in Devel 8.2
Same name and namespace in other branches
- 8.3 devel_generate/src/DevelGenerateBase.php \Drupal\devel_generate\DevelGenerateBase::setMessage()
- 8 devel_generate/src/DevelGenerateBase.php \Drupal\devel_generate\DevelGenerateBase::setMessage()
- 4.x devel_generate/src/DevelGenerateBase.php \Drupal\devel_generate\DevelGenerateBase::setMessage()
Set a message for either drush or the web interface.
Parameters
string $msg: The message to display.
string $type: (optional) The message type, as defined in MessengerInterface. Defaults to MessengerInterface::TYPE_STATUS
9 calls to DevelGenerateBase::setMessage()
- ContentDevelGenerate::contentKill in devel_generate/
src/ Plugin/ DevelGenerate/ ContentDevelGenerate.php - Deletes all nodes of given node types.
- ContentDevelGenerate::generateContent in devel_generate/
src/ Plugin/ DevelGenerate/ ContentDevelGenerate.php - Method responsible for creating content when the number of elements is less than 50.
- ContentDevelGenerate::settingsForm in devel_generate/
src/ Plugin/ DevelGenerate/ ContentDevelGenerate.php - Returns the form for the plugin.
- DevelGenerateBase::generate in devel_generate/
src/ DevelGenerateBase.php - Execute the instructions in common for all DevelGenerate plugin
- ExampleDevelGenerate::generateElements in devel_generate/
tests/ modules/ devel_generate_example/ src/ Plugin/ DevelGenerate/ ExampleDevelGenerate.php - Business logic relating with each DevelGenerate plugin
File
- devel_generate/
src/ DevelGenerateBase.php, line 148
Class
- DevelGenerateBase
- Provides a base DevelGenerate plugin implementation.
Namespace
Drupal\devel_generateCode
protected function setMessage($msg, $type = MessengerInterface::TYPE_STATUS) {
if (function_exists('drush_log')) {
$msg = strip_tags($msg);
drush_log($msg);
}
else {
\Drupal::messenger()
->addMessage($msg, $type);
}
}