Skip to content

Instantly share code, notes, and snippets.

@radutopala
Created July 17, 2012 09:29
Show Gist options
  • Save radutopala/3128329 to your computer and use it in GitHub Desktop.
Save radutopala/3128329 to your computer and use it in GitHub Desktop.
Example of closing or opening popup after submit
<?php
// not opening the popup again after submitting
class skillEditAction extends simpleWidgetEditAction
{
public function execute($request)
{
if ($request->isMethod('post')) {
if ($this->processPostData()) {
$result = array(
'success' => true,
'message' => "Saved with success!",
);
return $result;
}
}
}
}
<?php
// opening the popup again after submitting
class skillEditAction extends simpleWidgetEditAction
{
public function execute($request)
{
if ($request->isMethod('post')) {
if ($this->processPostData()) {
$result = array(
'success' => true,
'message' => "Saved with success!",
'redirect' => $this->widgetUri . '?id=' . $this->object->getId()
);
return $result;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment