PHP code example of bootiq / cms-api-vendor-nette

1. Go to this page and download the library: Download bootiq/cms-api-vendor-nette 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/ */

    

bootiq / cms-api-vendor-nette example snippets


    /**
     * @var PageControlFactory
     * @inject
     */
    public $pageControlFactory;

    /**
     * @return PageControl
     */
    public function createComponentPageControl(): PageControl
    {
        $control = $this->pageControlFactory->create();
        return $control;
    }

    /**
     * @var PageControlFactory
     * @inject
     */
    public $pageControlFactory;

    /**
     * @return PageControl
     */
    public function createComponentPageControl(): PageControl
    {
        $control = $this->pageControlFactory->create();
        
        $control->onNotRendered[] = function ($exception) {
            // DO SOMETHING WITH EXCEPTION
        };
        $control->onBlockNotRendered[] = function ($block, $exception) {
            // DO SOMETHING WITH BLOCK OR EXCEPTION
        };        
        
        return $control;
    }

    /**
     * @var PageControlFactory
     * @inject
     */
    public $pageControlFactory;

    /**
     * @return PageControl
     */
    public function createComponentPageControl(): PageControl
    {
        $control = $this->pageControlFactory->create();
        $myOwnBlockControl = new MyOwnBlockControl();
         
        $control->addBlockControlByType($myOwnBlockControl, 'myOwnBlockType');
        
        return $control;
    }

    /**
     * @var PageControlFactory
     * @inject
     */
    public $pageControlFactory;

    /**
     * @var LoggerInterface
     * @inject
     */
    public $monologLogger;    

    /**
     * @return PageControl
     */
    public function createComponentPageControl(): PageControl
    {
        $control = $this->pageControlFactory->create();
         
        $control->setLogger($this->monologLogger);
        
        return $control;
    }