PHP code example of ginger-tek / jerpy

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

    

ginger-tek / jerpy example snippets


$layout = 'default';

$routes = [
  '/' => 'pages/home.php'
];

$routes = [
  '/about' => [
    'page' => 'pages/about.php',
    'layout' => 'layouts/layout2.php'
  ]
];

$routes = [
  '/about' => [
    'page' => 'pages/about.php',
    'title' => 'About',
    'thumbnail' => '/assets/my_thumbnail.png'
  ]
];

$routes = [
  '/products/:id' => 'pages/product.php'
];

<p>ID: <?= $req->params->id 



ion md(string $path): string
{
  return (new Parsedown)->text(file_get_contents($path));
}

$plugins = [
  'md'
];

<?= md('path/to/markdown-file.md') 

🗀 layouts
  🗋 default.php

🗀 pages
  🗋 home.php

🗀 plugins
  🗀 myPlugin <-- plugin dir
    🗋 composer.json
    🗋 myPlugin.php <-- entrypoint (same as plugin dir)
    🗀 vendor
      🗋 someSupportingFile.php