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


$routes = [
  '/' => [
    'page' => 'home.php',
    'meta' => [
      'title' => 'Welcome to my site!'
    ]
  ],
  '/about' => [
    'page' => 'about.php',
    'meta' => [
      'title' => 'About Us',
      'thumbnail' => '/assets/my_thumbnail.png'
    ],
    'layout' => 'layout_2'
  ],
  '/simple/page' => 'simple_page.php',
  '/page/without/layout' => [
    'page' => 'some_page.php',
    'layout' => false
  ]
]

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

<p>ID: <?= $params['id'] 



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

$plugins = [
  'md'
];

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

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