I thought that
fopen/fwrite/fclose would work, but I’m doing something wrong.
if ( ($resource->get( ‘template’ ) == 57) && ($modx->event->name == ‘OnDocFormSave’) ) :
//$file = '/assets/elements/shared/privacypolicy.php'; $file = fopen( "/assets/elements/shared/privacypolicy.php" ) or die("unable to open file!"); $newContent = $resource->get( 'content' ); //$resource->file_put_contents( $file, $newContent ); fwrite( $file, $newContent ); fclose( $file );
Any help would be appreciated.