Quantcast
Channel: Editor — DataTables forums
Viewing all articles
Browse latest Browse all 3744

setting a php session variable in the php processing script

$
0
0

I want to do something that seems like it should be simple but I can not figure it out. I want to take a FEILD:: instance and pass it to a php session variable.

I tried:

Editor::inst( $db, 'ia_application.plf_data', 'plf_id' )
    ->field(
        Field::inst( 'ia_application.plf_data.plf_id' ),
    ->on( 'preCreate', function ( $editor, $values ) {
        $editor
            ->field( 'ia_application.plf_data.plf_id' )
            ->setValue( $_SESSION['plf_id'] );
    } )
    ->on( 'preEdit', function ( $editor, $id, $values ) {
        $editor
            ->field( 'ia_application.plf_data.plf_id' )
         ->setValue( $_SESSION['plf_id'] );
    } )

    ->process($_POST)
    ->json();

with no joy... Can someone please show me how I can accomplish this?
Thanks in advance!


Viewing all articles
Browse latest Browse all 3744

Trending Articles