Можно
передавать переменную название таблицы - а все остальное оставить как есть
в контроллер вынести из системных файлов сохранение, удаление и прочее
и там передавать переменную
пример удаления
переменная $kat = JRequest::getInt('kat'); = это будет номер таблицы
public function delete()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
$kat = JRequest::getInt('kat');
// Get items to remove from the request.
$cid = JFactory::getApplication()->input->get('cid', array(), 'array');
if (!is_array($cid) || count($cid) < 1)
{
JLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror');
}
else
{
// Get the model.
$model = $this->getModel();
// Make sure the item ids are integers
jimport('joomla.utilities.arrayhelper');
JArrayHelper::toInteger($cid);
// Remove the items.
if ($model->delete($cid))
{
$this->setMessage(JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid)));
}
else
{
$this->setMessage($model->getError(), 'error');
}
// Invoke the postDelete method to allow for the child class to access the model.
$this->postDeleteHook($model, $cid);
}
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list.'&kat='.$kat, false));
}
пример таблицы
<?php
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filter.input');
class Tableorder extends JTable
{
function __construct(& $db) {
$kat = JRequest::getInt('kat',1);
parent::__construct('#__xxx_order'.$kat, 'id', $db);
}
}
?>