Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82815

Editor 1.6.1 PHP Options error

$
0
0

Hi,

Since ver. 1.6.1 all of my tables stopped working because I used options. I tried one of the examples from the datatables.net, but it gives me the same error. Did I miss something when I updated the version? What can be the solution for this error?

I tried https://editor.datatables.net/examples/inline-editing/join.html

Fatal error: Uncaught exception 'ReflectionException' with message 'Class DataTables\Editor\Options does not have a constructor, so you cannot pass any constructor arguments' in /virtual/111.89.201.247/ssl/home/example/php/Ext/Ext.php:50
Stack trace:

newInstanceArgs(Array)">newInstanceArgs(Array)">0 /virtual/111.89.201.247/ssl/home/example/php/Ext/Ext.php(50): ReflectionClass->newInstanceArgs(Array)

1 /virtual/111.89.201.247/ssl/home/example/examples/php/join.php(26): DataTables\Ext::inst()

2 {main}

thrown in /virtual/111.89.201.247/ssl/home/example/php/Ext/Ext.php on line 50

// DataTables PHP library
include( "../../php/DataTables.php" );

// Alias Editor classes so they are easy to use
use
    DataTables\Editor,
    DataTables\Editor\Field,
    DataTables\Editor\Format,
    DataTables\Editor\Mjoin,
    DataTables\Editor\Options,
    DataTables\Editor\Upload,
    DataTables\Editor\Validate;


/*
 * Example PHP implementation used for the join.html example
 */
Editor::inst( $db, 'users' )
    ->field(
        Field::inst( 'users.first_name' ),
        Field::inst( 'users.last_name' ),
        Field::inst( 'users.phone' ),
        Field::inst( 'users.site' )
            ->options( Options::inst()
                ->table( 'sites' )
                ->value( 'id' )
                ->label( 'name' )
            )
            ->validator( 'Validate::dbValues' ),
        Field::inst( 'sites.name' )
    )
    ->leftJoin( 'sites', 'sites.id', '=', 'users.site' )
    ->process($_POST)
    ->json();

Viewing all articles
Browse latest Browse all 82815

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>