PHP code example of faxity / anax-layout

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

    

faxity / anax-layout example snippets


"layout" => [
    "region" => "layout",
    // Change here to use your own templatefile as layout
    "template" => "faxity/layout/default",
    // ..rest
],
"views" => [
    [
        "region"   => "header-logo",
        "template" => "faxity/navbar/logo",
        // ..rest
    ],
    [
        "region"   => "header",
        "template" => "faxity/navbar/header",
        // ..rest
    ],
    [
        "region"   => "header-mobile",
        "template" => "faxity/navbar/responsive",
        // ..rest
    ],
    [
        "region"   => "footer",
        "template" => "faxity/columns/default",
        // ..rest
    ],
],

//$di is the di package manager in Anax
$di->flash->ok("ok message");
$di->flash->warn("warning message");
$di->flash->err("error message");

// The flash messages by default are set in the session for the next request
// However to set a flash message in the current request just set the second argument to true
$di->flash->ok("immediate ok message", true);
$di->flash->warn("immediate warning message", true);
$di->flash->err("immediate error message", true);