Hey all !!
So, I've hit my head against a wall for the last several hours, and
done all the searches I can think of.....and, I just cannot think of
any other way of tackling this problem.
I've created a view/controller that do not have a model. Based on a a
choice the user makes, the controller saves to one of three other
models.
Here is my controller code :
=============================================================
function newkeyword() {
if (empty ($this->data)) {
$this->render();
} else {
$this->cleanUpFields();
$type = $this->data['Keyword']['Type'];
$mdlName = null;
switch ($type) {
case "help" :
$mdlName = 'HelpCategory';
break;
case "cat" :
$mdlName = 'Category';
break;
case "sub" :
$mdlName = 'SubCategory';
break;
}
$saveData[$mdlName]['frText'] =
$this->data['Keyword']['frText'];
$saveData[$mdlName]['engText'] =
$this->data['Keyword']['engText'];
if ($this->$mdlName->save($saveData)) {
debug('SAVED');
$this->redirect('/keywords/keywordlist');
debug('AFTER Redirect');
} else {
debug('ERROR');
$this->Session->setFlash('Please correct errors
below.');
}
}
}
=============================================================
The debug statements and looking at the DB shows that the save has
occurred successfully. But, rather than re-direct-ing to the
keywordslist page, the same page is reloaded (namely,
keywords/newkeyword).
What am I missing ? It seems to make perfect sense to me that this
should work.
Thanks all !
Syl
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---