Code: Select all
$model->save($data);// i call the model operation and save data
$lastIdOperation = $model->getLastInsertedId();
// here I create a new item in the same model but in another table and i get the last inserted id $model->creeNouvelleTransactionDeboureLieeAOperation($lastIdOperation);
$idTransaction = $model->getLastInsertedIdTransactionDeboure();
// and here is set the redirect to another controller (view)
$app = JFactory::getApplication();
$url = JRoute::_('index.php?option=com_tktransit&view=transaction_deboure&layout=edit&is_from_operation=1&id='.(int)$idTransaction, false);
$app->redirect($url);
}
You are not permitted to use that link to directly access that page {the id of the item that I edit}