PHP code example of oliverkroener / ok-typo3-helper
1. Go to this page and download the library: Download oliverkroener/ok-typo3-helper 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/ */
use OliverKroener\Helpers\Service\SiteRootService;
// Injected via DI (registered public in Configuration/Services.yaml)
$rootPageId = $siteRootService->findNextSiteRoot($currentPageId); // int|null
use OliverKroener\Helpers\Traits\ReflectionPropertiesTrait;
class MyModel
{
use ReflectionPropertiesTrait;
private string $title = '';
}
$model = new MyModel();
$model->setTitle('Hello'); // routed through __call → reflection
echo $model->getTitle(); // "Hello"