PHP code example of nattreid / cms

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

    

nattreid / cms example snippets


namespace App\Cms\Example\Presenters;

class TestPresenter extends \NAttreid\Cms\Control\ModulePresenter {
    public function renderDefault() {
        // pro zobrazeni menu v mobilu (defaultne je skryto)
        $this->viewMobileMenu();
        
        // pridani tlacitka do Dockbaru
        $this['dockbar']->addLeftLink('tlacitko', 'link!');
        // nebo
        $this['dockbar']->addLeftLink('tlacitko')
            ->addClass('trida'); // spusteni pomoci javascriptu
            
        // tlacitko vpravo
        $this['dockbar']->addRightLink('tlacitko')
    }
}

class ExampleExtension extends \NAttreid\Cms\DI\ModuleExtension {

    protected $namespace = 'example';
    protected $dir = __DIR__;
    protected $package = 'Package\\';

    public function beforeCompile() {
        parent::beforeCompile();
        $this->addLoaderFile('cestaKCssNeboJs');
        $this->addLoaderFile('cestaKLocalizovanemuJs','cs');
    }

}

namespace Package\Example\Presenters;

class TestPresenter extends \NAttreid\Cms\Control\ModulePresenter {
    
}

class CmsSettings implements ISettings {
    
    public function init(\Nette\Application\UI\ITemplate $template, \NAttreid\Cms\Control\AbstractPresenter $presenter)
	{
		// php kod ...
	}
}

$this->ajaxRedirect('link', ['args']);