PHP code example of capachow / arcane

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

    

capachow / arcane example snippets


 define('ROUTES', [
  ['history'], # /blog/history
  [['2023', '2024']], # /blog/2023 or /blog/2024
  ['*'] # /blog/anything
]);

$slug = path(1); 
 shell
curl -fsLO copy.arcane.dev/index.php
 php
 $mode = env('IS_ALLOWED', 'true'); 
 php
<?= path(); # /blog/2024 
 php
<?= path(1); # first-segment 
 php
<?= path('/about/'); # normalized to /about 
 relay('SITE', 'Name', true); 
 relay('title', 'Home'); 
 relay('sidebar', function() { 
 }); 
 return [
  'items' => 3,
  'total' => 99.00
]; 
 $truncate =  'excerpt' => $truncate($post['body'], 160)
];