PHP code example of charcoal / core

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

    

charcoal / core example snippets


$model = ModelFactory::instance()->create('namespace/model');
$source = SourceFactory::instance()->create('database');
$source->load_item(1, $model);

// Model implements StorableInterface with StorableTrait
$model = ModelFactory::instance()->create('namespace/model');
// This will load the Model's source from it's metadata
$model->load(1);