Lol ich hab gerade bemerkt, das ich gar keine variable habe in der klammer($uebergabe) ups.
hab jetzt folgendes gemacht. CONTROLLER für andere auch
PHP-Code:
function save()
{
$model = $this->getModel('kategorie_detail');
//get data from request
$post = JRequest::get('post');
$post['content'] = JRequest::getVar('content', '', 'post', 'string', JREQUEST_ALLOWRAW);
if ($model->store($post)) {
$msg = JText::_( 'Kategorie erfolgreich gespeichert' );
} else {
$msg = JText::_( 'Fehler beim speichern' );
}
// Check the table in so it can be edited.... we are done with it anyway
$link = 'index.php?option=com_produkte&view=kategorie';
$this->setRedirect($link, $msg);
}
und store aus der model datei
PHP-Code:
function store($data)
{
$row =& $this->getTable();
//$data = JRequest::get( 'post' );
// Bind the form fields to the hello table
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Make sure the hello record is valid
if (!$row->check()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Store the web link table to the database
if (!$row->store()) {
$this->setError( $row->getErrorMsg() );
return false;
}
return true;
}
was bringt das public vor der function und du hast save($data) benutzt ist das ne kurz vorm so das ich meine Store funcion kürzen kann?
Lesezeichen