PHP code example of andrexm / astatine

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

    

andrexm / astatine example snippets




statine\Engine;

$engine = Engine::getInstance();
$engine::config(
    "views", // Directory for your template files 
    "cache/views", // Directory for your compiled files (must be writable)
    ".php" // OPTIONAL: by default, the engine will look for .blade.php files
);

// Render a template
$engine::render('index', ['name' => 'John Doe']);

@if (condition):
    ...
@elseif (condition):
    ...
@else:
    ...
@endif

@foreach ($array as $key => $value):
    ...
@foreach ($array as $value):
    ...
@endforeach

@for ($i = 0; $i < 10; $i++):
    ...
@endfor

@while (condition):
    ...
@endwhile