1. Go to this page and download the library: Download giginc/cakephp3-driver-json 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/ */
giginc / cakephp3-driver-json example snippets
'Datasources' => [
'default' => [
'className' => 'Giginc\Json\Database\Connection',
'driver' => 'Giginc\Json\Database\Driver\Json',
'baseDir' => './', // local path on the server relative to WWW_ROOT
],
],
//src/Model/Table/YourTable.php
use Giginc\Json\ORM\Table;
class CategoriesTable extends Table {
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('categories'); // load file is WWW_ROOT/categories.json
}
}