public function doAdd($data, Form $form) {
        $record=$this->getRecord(null);
        $form->saveInto($record);
        $record->write();
        
        $editController=singleton('CodeBank');
        $editController->setCurrentPageID($record->ID);
        
        return $this->redirect(Controller::join_links(singleton('CodeBank')->Link('show'), $record->ID));
    }
public function doAdd($data, Form $form) {
        $record=$this->getRecord(null);
        $form->saveInto($record);
        $record->write();
        
        $editController=singleton('CodeBank');
        $editController->setCurrentPageID($record->ID);
        
        return $this->redirect(Controller::join_links(singleton('CodeBank')->Link('show'), $record->ID));
    }
public function doAdd ( $ data , Form $ form ) { $ record = $ this -> getRecord ( null ) ; $ form -> saveInto ( $ record ) ; $ record -> write ( ) ; $ editController = singleton ( 'CodeBank' ) ; $ editController -> setCurrentPageID ( $ record -> ID ) ; return $ this -> redirect ( Controller :: join_links ( singleton ( 'CodeBank' ) -> Link ( 'show' ) , $ record -> ID ) ) ; }
Handles adding the snippet to the database
@param {array} $data Data submitted by the user
@param {Form} $form Form submitted
Handles adding the snippet to the database