×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Redirect to home after saving
Marcos
New Member
Posts: 5
pred 8 rokmi 9 mesiacmi #1213
od Marcos
Redirect to home after saving bolo vytvorené Marcos
Hi, could someone help me redirect to the main page after you saved the item on the front end?
At controllers.php I found this line:
// Redirect to the list screen.
$this->setMessage(JText::_('COM_PEDIDODEMUSICA_ITEM_SAVED_SUCCESSFULLY'));
$menu = JFactory::getApplication()->getMenu();
$item = $menu->getActive();
$url = (empty($item->link) ? 'index.php?option=com_pedidodemusica&view=pedidos' : $item->link);
$this->setRedirect(JRoute::_($url, false));
I need change to redirect to home. Thank You
At controllers.php I found this line:
// Redirect to the list screen.
$this->setMessage(JText::_('COM_PEDIDODEMUSICA_ITEM_SAVED_SUCCESSFULLY'));
$menu = JFactory::getApplication()->getMenu();
$item = $menu->getActive();
$url = (empty($item->link) ? 'index.php?option=com_pedidodemusica&view=pedidos' : $item->link);
$this->setRedirect(JRoute::_($url, false));
I need change to redirect to home. Thank You
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Francesco Reitano
New Member
Posts: 7
pred 8 rokmi 9 mesiacmi #1214
od Francesco Reitano
Odpoveď od Francesco Reitano na tému Redirect to home after saving
it's easy, change $url:
$url="index.php";
$url="index.php";
Nasledujúci užívateľ(ia) povedali ďakujem: Andres Maeso
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Marcos
New Member
Posts: 5
pred 8 rokmi 9 mesiacmi #1220
od Marcos
Odpoveď od Marcos na tému Redirect to home after saving
Works man.. thankyou! But at the last line i need change to:
$this->setRedirect($url);
$this->setRedirect($url);
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Dariusz
New Member
Posts: 7
pred 8 rokmi 5 mesiacmi - pred 8 rokmi 5 mesiacmi #1351
od Dariusz
Odpoveď od Dariusz na tému Redirect to home after saving
I have the same question but concerning backend. Can anybody help me please? (concern task save)
EDIT
SOLVED:
overwrite controller:
public function save($key = null, $urlVar = null)
{
$return = parent::save($key, $urlVar);
$this->setRedirect( JRoute::_( 'index.php' ));
return $return;
}
EDIT
SOLVED:
overwrite controller:
public function save($key = null, $urlVar = null)
{
$return = parent::save($key, $urlVar);
$this->setRedirect( JRoute::_( 'index.php' ));
return $return;
}
Posledný krát upravené:pred 8 rokmi 5 mesiacmi Dariusz Dôvod: ADD SOLVED
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Čas vytvorenia stránky: 0.056 sekúnd