×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Redirect to home after saving
Marcos
Fresh Boarder
Posts: 5
8 Jahre 9 Monate her #1213
von Marcos
Redirect to home after saving wurde erstellt von 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
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
Francesco Reitano
Fresh Boarder
Posts: 7
8 Jahre 9 Monate her #1214
von Francesco Reitano
Francesco Reitano antwortete auf Redirect to home after saving
it's easy, change $url:
$url="index.php";
$url="index.php";
Folgende Benutzer bedankten sich: Andres Maeso
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
Marcos
Fresh Boarder
Posts: 5
8 Jahre 9 Monate her #1220
von Marcos
Marcos antwortete auf Redirect to home after saving
Works man.. thankyou! But at the last line i need change to:
$this->setRedirect($url);
$this->setRedirect($url);
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
Dariusz
Fresh Boarder
Posts: 7
8 Jahre 5 Monate her - 8 Jahre 5 Monate her #1351
von Dariusz
Dariusz antwortete auf 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;
}
Letzte Änderung: 8 Jahre 5 Monate her von Dariusz. Grund: ADD SOLVED
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
Ladezeit der Seite: 0.055 Sekunden