Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
VizionDev Posted September 7, 2015 Posted September 7, 2015 I have the following: //<?php $editing = NULL; if ( \IPS\Request::i()->id ) { try { $editing = \IPS\app\Thing::load( \IPS\Request::i()->id ); } catch ( \OutOfRangeException $e ) { var_dump(\IPS\Output::i()->error( 'error' )); } } $form = new \IPS\Helpers\Form; $form->add( new \IPS\Helpers\Form\Editor( 'col1_content', NULL, TRUE, array( 'app' => 'app', 'key' => 'Key', 'autoSaveKey' => $editing ? 'creating-thing' : "editing-thing-{$editing->id}", 'attachIds' => $editing ? array( $editing->id ) : NULL ) ) ); if ( $values = $form->values() ) { if ( !$editing ) { $item = new \IPS\app\Thing; $item->content = $values['col1_content']; $item->save(); \IPS\File::claimAttachments( 'creating-thing', $item->id ); } else { $editing->content = $values['col1_content']; $editing->save(); } } return $form; Which is documented in https://community.invisionpower.com/4docs/advanced-usage/development/editor-r78/ However I get the following: Any ideas?
VizionDev Posted September 7, 2015 Author Posted September 7, 2015 Ok so worked out you don't need most of the above.$form->add( new \IPS\Helpers\Form\Editor( 'col1_content', \IPS\Settings::i()->col1_content, FALSE, array( 'app' => 'core', 'key' => 'Admin', 'autoSaveKey' => 'col1_content' ) ) );Does the trick without all the other junk
Recommended Posts
Archived
This topic is now archived and is closed to further replies.