PHP code example of phly / phly-simple-page

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

    

phly / phly-simple-page example snippets



return [
    'modules' => [
        'PhlySimplePage',
        'Application',
    ],
];

use PhlySimplePage\PageController;

return [
    'router' => [
        'routes' => [
            'about' => [
                'type' => 'Literal',
                'options' => [
                    'route' => '/about',
                    'defaults' => [
                        'controller' => PageController::class,
                        'template'   => 'application/pages/about',
                        // optionally set a specific layout for this page
                        'layout'     => 'layout/some-layout',
                    ],
                ],
            ],
        ],
    ],
];

return [
    'phly-simple-page' => [
        'cache' => [
            'adapter' => [
                'name'   => 'filesystem',
                'options' => [
                    'namespace'       => 'pages',
                    'cache_dir'       => getcwd() . '/data/cache',
                    'dir_permission'  => '0777',
                    'file_permission' => '0666',
                ],
            ],
        ],
    ],
];

return [
    'service_manager' => [
        'factories' => [
            'PhlySimplePage\PageCache' => \PhlySimplePage\PageCacheFactory::class,
        ],
    ],
];

'about' => [
    'type' => 'Literal',
    'options' => [
        'route' => '/about',
        'defaults' => [
            'controller'   => \PhlySimplePage\PageController::class,
            'template'     => 'application/pages/about',
            'do_not_cache' => true,
        ],
    ],
],