PHP code example of philwc / version-db

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

    

philwc / version-db example snippets


#!/usr/bin/env php

or/philwc/version-db/console';

$change = new \philwc\Web\AddChange();
$change->getHtml($action);

$change = new \philwc\Web\AddChange();
$html   = '<form id="vdbAdd" method="POST">';
foreach ($change->getFields() as $field) {
    //Split the fields names into a nice title format
    $a          = preg_split('/(?<=[a-z])(?=[A-Z])/x', $field);
    $fieldTitle = ucwords(implode(' ', $a));

    $html .= '<label class="input-group" for="' . $field . '">' . $fieldTitle . ': <input class="visibleInput" type="text" name="' . $field . '" id="' . $field . '"/></label>';
}
$html .= '<input name="submit" type="submit"></form>';

echo $html;
bash
php console add
bash
php console upgrade
bash
php console downgrade