1. Go to this page and download the library: Download wriver4/activerecord 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/ */
wriver4 / activerecord example snippets
$loader = addPsr4('Models\\', __dir__.'\Models');
// What? Why? Composers base path is vendor and I don't want to update Composer for every new Model.
//Simple Config
$cfg = Activerecord\Config::instance();
$cfg->setConnections(array(
'development' =>
'mysql://root:root@localhost/treebark?charset=utf8'));
namespace Models;
class Bar \\ for table name bars by convention
extends \Activerecord\Model \\ leading slash