public function ModalPage::getModalToShowByParameter in Modal 8.2
Same name and namespace in other branches
- 8.3 src/ModalPage.php \Drupal\modal_page\ModalPage::getModalToShowByParameter()
Get the modal by parameter.
Parameters
object $modal: The object modal.
string $modalParamenter: The string text of parameters.
Return value
bool Return modal or false.
1 call to ModalPage::getModalToShowByParameter()
- ModalPage::getModalToShow in src/
ModalPage.php - Get modal to show.
File
- src/
ModalPage.php, line 290
Class
- ModalPage
- Modal Page Class.
Namespace
Drupal\modal_pageCode
public function getModalToShowByParameter($modal, $modalParamenter) {
$parameters = $modal->parameters->value;
$parameters = explode(PHP_EOL, $parameters);
foreach ($parameters as $parameter) {
$parameter = trim($parameter);
if ($modalParamenter == $parameter) {
return $modal;
}
}
return FALSE;
}