PHP code example of cable8mm / stub-template

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

    

cable8mm / stub-template example snippets


$stub = Stub::of(__DIR__.'/stubs/sample.stub',
  [
    'title' => 'Home Page',
    'colors' => ['red', 'blue', 'green'],
  ]
)->render()

$stub = Stub::of('stubs/sample.stub',
  [
    'title' => 'Home Page',
    'colors' => ['red', 'blue', 'green'],
  ],
  __DIR__
)->render()
twig filename="stubs/sample.stub"
{{ title }} -  echo date('Y-m-d') 
html
Home Page -  echo date('Y-m-d')