PHP code example of esit / scopehelper
1. Go to this page and download the library: Download esit/scopehelper library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
esit / scopehelper example snippets
declare(strict_types=1);
namespace Esit\Imageport\Classes\Contao\Elements;
use Contao\ContentElement;
use Contao\System;
use Esit\Scopehelper\Classes\Services\Helper\ScopeHelper;
class ContentTestElement extends ContentElement
{
// ...
protected function compile(): void
{
$scopeHelper = System::getContainer()->get(ScopeHelper::class);
if (true === $scopeHelper?->isBackend()) {
// Ausgabe für das Backend
} else {
// Ausgabe für das Frontend
}
}
}