PHP code example of zeroseven / pagebased

1. Go to this page and download the library: Download zeroseven/pagebased 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/ */

    

zeroseven / pagebased example snippets


call_user_func(static function () {
    $object = \Zeroseven\Pagebased\Registration\ObjectRegistration::create('Job')
        ->setClassName(\Vendor\NewExtension\Domain\Model\Job::class)
        ->setControllerClass(\Vendor\NewExtension\Controller\JobController::class)
        ->setRepositoryClass(\Vendor\NewExtension\Domain\Repository\JobRepository::class)
        ->setSorting('title') // Sort jobs by their title (backend and frontend)
        ->enableDate()        // Enable date field for job objects
        ->enableTop()         // Enable top feature for job objects
        ->enableTags()        // Enable tag feature for job objects, so tagging and filtering tags is possible
        ->enableTopics(24)    // Enable topics for jobs and give it a pid where to store these
        ->enableContact(24);  // Enable responsible contact person for job objects

    $category = \Zeroseven\Pagebased\Registration\CategoryRegistration::create('Job-Category')
        ->setClassName(\Vendor\NewExtension\Domain\Model\Category::class)
        ->setRepositoryClass(\Vendor\NewExtension\Domain\Repository\CategoryRepository::class)
        ->setDocumentType(44)  // Set document type for category pages (



declare(strict_types=1);

namespace Zeroseven\Jobs\EventListener;

use Zeroseven\Pagebased\Registration\Event\AddFlexFormEvent;

class ExtendFlexFormEvent
{
    public function __invoke(AddFlexFormEvent $event)
    {
        $flexFormConfiguration = $event->getFlexFormConfiguration();

        if ($flexFormConfiguration->getType() === 'jobs_list' && $sheet = $flexFormConfiguration->getSheet('filter')) {
            $sheet->addField('settings.customField', [
                'type' => 'input',
                'eval' => 'trim,