DataTables Editor installed via Composer
DataTables Editor installed via Composer
How to use DataTables Editor installed via Composer?
use
DataTables\Editor,
DataTables\Editor\Field,
DataTables\Editor\Format,
DataTables\Editor\Mjoin,
DataTables\Editor\Options,
DataTables\Editor\Upload,
DataTables\Editor\Validate,
DataTables\Editor\ValidateOptions;
require '../config.php';
require '../vendor/autoload.php';
Editor::inst( $db, 'filters' )
->fields(
...
and getting errors like: Uncaught Error: Call to a member function transaction() on null, because $db is NULL.
This question has an accepted answers - jump to answer
Answers
Hi,
When you do a Composer install, you need to make the database connection yourself. As you'll see in the documentation that is typically something like:
You could put that into
config.php
if you want to to allow it to be shared between files.Allan
Thanks, Allan!