Hello! This may be a very "noob-ish" question, but I have been unable to find a similar scenario in the tutorials, documentation or forums.
I have a form set up on the "FacultyProfile" pages when the logged in member matches, so that they can edit a little mini-profile. When I save/write the data, it seems to update okay (no errors, and when I refresh, the changes appear on the front end). However, when going in to the CMS, the changes are not reflected in there.
class FacultyProfile extends Page {
static $db = array(
'LastName' => 'Text',
'FirstName' => 'Text',
'YourTitle' => 'Text',
'E-MailAddress' => 'Text',
'WebSite' => 'Text'
);
function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new TextField('LastName'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('FirstName'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('YourTitle'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('E-MailAddress'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('WebSite'), 'Content');
return $fields;
}
}
class FacultyProfile_Controller extends Page_Controller {
// i removed the other methods that are working already
function SaveProfile($data, $form) {
$form->saveInto($this);
$this->write();
Director::redirect('profile-updated');
}
}