PHP code example of tatter / themes

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

    

tatter / themes example snippets


    /**
     * List of filter aliases that are always
     * applied before and after every request.
     *
     * @var array
     */
    public $globals = [
        'before' => [
            // 'honeypot',
            // 'csrf',
            // 'invalidchars',
        ],
        'after' => [
            'themes',
        ],
    ];

$routes->add('shop/(:segment)', 'ShopController::index', ['filter' => 'themes']);

$routes->add('heroes/(:segment)', 'HeroController::$1', ['filter' => 'themes:Heroic']);

$theme = theme();
echo 'Current theme is ' . $theme->name . ': "' . $theme->description . '"';
html
<form name="user-settings" action="<?= site_url('users/settings')