× Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues

Redirect to home after saving

8 года 3 мес. назад #1213 от Marcos
Marcos создал тему: Redirect to home after saving
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
Вложения:

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

8 года 3 мес. назад #1214 от Francesco Reitano
Francesco Reitano ответил в теме Redirect to home after saving
it's easy, change $url:
$url="index.php";
Спасибо сказали: Andres Maeso

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

8 года 3 мес. назад #1220 от Marcos
Marcos ответил в теме Redirect to home after saving
Works man.. thankyou! But at the last line i need change to:

$this->setRedirect($url);

:)

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

7 года 11 мес. назад - 7 года 11 мес. назад #1351 от Dariusz
Dariusz ответил в теме 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;
}
Последнее редактирование: 7 года 11 мес. назад пользователем Dariusz. Причина: ADD SOLVED

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

1 год 5 мес. назад #10012 от Philips Reyes
Philips Reyes ответил в теме Redirect to home after saving
This is very simple task for redirect .
I use this seotoolsystem.com/htaccess-redirect-generatorfor redirect purpose this is very quicker approches.

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

1 год 5 мес. назад #10028 от Weaver
Weaver ответил в теме Redirect to home after saving
Hello Philips Reyes ,
Thank you so much for your reply , you answer really very helpful for me.

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

Время создания страницы: 0.139 секунд
Работает на Kunena форум

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.