public function InstapageCmsPluginDrupal8Connector::checkPage in Instapage plugin 8.3
Same name and namespace in other branches
- 7.3 core/connectors/InstapageCmsPluginDrupal8Connector.php \InstapageCmsPluginDrupal8Connector::checkPage()
Checks (and displays) if a landing page should be displayed instead of normal content served by CMS.
Parameters
string $type Type of page to check ('page', 'home' or '404').:
string $slug Slug to check. Default: ''.:
3 calls to InstapageCmsPluginDrupal8Connector::checkPage()
- InstapageCmsPluginDrupal8Connector::check404 in core/
connectors/ InstapageCmsPluginDrupal8Connector.php - Checks (and displays) if a landing page marked as 404 should be displayed instead of normal CMS 404 page.
- InstapageCmsPluginDrupal8Connector::checkCustomUrl in core/
connectors/ InstapageCmsPluginDrupal8Connector.php - Checks (and displays) if a landing page hould be displayed instead of normal CMS page under current URL.
- InstapageCmsPluginDrupal8Connector::checkHomepage in core/
connectors/ InstapageCmsPluginDrupal8Connector.php - Checks (and displays) if a landing page marked as homepage should be displayed instead of normal CMS homepage.
File
- core/
connectors/ InstapageCmsPluginDrupal8Connector.php, line 504
Class
- InstapageCmsPluginDrupal8Connector
- Class that utilizes native Drupal 8 functions to perform actions like remote requests and DB operations.
Code
public function checkPage($type, $slug = '') {
$page = InstapageCmsPluginPageModel::getInstance();
$result = $page
->check($type, $slug);
if (!$result) {
return;
}
if ($type === '404') {
$page
->display($result, '404 Not Found');
}
else {
$page
->display($result);
}
}