PHP code example of monomelodies / ornament

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

    

monomelodies / ornament example snippets




use Ornament\Model;
use Ornament\Adapter\Pdo;

class MyModel
{
    use Model;

    // Public properties on a Model are considered "handleable" by Ornament:
    public $id;
    public $name;
    public $value;

    public function __construct()
    {
        $this->addAdapter(new Pdo($GLOBALS['database']));
    }
}