Skip to content

Instantly share code, notes, and snippets.

@ornicar
Created March 28, 2010 18:58
Show Gist options
  • Save ornicar/346962 to your computer and use it in GitHub Desktop.
Save ornicar/346962 to your computer and use it in GitHub Desktop.
<?php
/**
* Message actions
*
*
*/
class messageActions extends myFrontModuleActions
{
public function executeFormWidget(dmWebRequest $request)
{
$form = new MessageForm();
//dmDebug::kill();
if ($request->hasParameter($form->getName()) && $form->bindAndValid($request) ) //throw $form->getErrorSchema();
{
//dmDebug::kill($message);
$message = $form->updateObject();
$message->dm_user_id = $this->getUser()->getDmUser()->id;
$message->save();
$this->redirectBack();
}
$this->forms['Message'] = $form;
//dmDebug::kill($message);
}
elseif($request->hasParameter($form->getName()))
{
throw $form->getErrorSchema();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment