Jason,
Thanks for your lightening response. I tried removing the ?>'s, to no avail. My goal is to get this little test app running so I can work on a larger intranet project. So I've included my code below in hopes that someone else's eyes will find my bug shallow.
When I run my app, I can display a form with data for one event record. When I submit that web form back from the browser, I get the following error:
DISABLE_PHRAME_ERROR_HANDLING debugging mode enabled
Warning: Cannot add header information - headers already sent by (output started at e:\php\phpdev\private\mysqlmvc\event_setup.php:111) in e:\php\phpdev\private\lib\phrame\ActionController.jes.php on line 250
Here are the relevant lines of code....
PHP Code:
/// SETUP ///////////////////////////////////////////////
lines 107-111
/// START SESSION
//all classes defined, we can now load the session
session_start();
/// SET ERROR HANDLING
if(defined('DISABLE_PHRAME_ERROR_HANDLING') && DISABLE_PHRAME_ERROR_HANDLING !== false)
{
error_reporting(E_ALL);
print "DISABLE_PHRAME_ERROR_HANDLING debugging mode enabled<p>\n";
}
/// ACTION ///////////////////////////
class UpdateEvent extends Action
{
function &Perform(&$poActionMapping, &$poActionForm)
{
global $gb_debug;
$event =& new Events;
// Get the Event Data for the current event_id
$rec['event_id'] = $poActionForm->Get('event_id');
$rec['event_title'] = $poActionForm->Get('event_title');
$rec['event_date_start'] = $poActionForm->Get('event_date_start');
$rec['event_date_end'] = $poActionForm->Get('event_date_end');
$update_id = $event->Update($rec);
if (!($update_id))
{
appl_error('Update Record failed');
exit;
} else
{
$o_action_forward =& $poActionMapping->Get('edit');
$o_action_forward->SetPath($o_action_forward->GetPath()."&event_id=$update_id");
return $o_action_forward;
}
}
}
/// MAPPING ///////////////////////////////////
/// EventMap.php: Extends Mapping Manager
class EventsMap extends MappingManager
{
// UPDATE
$this->_AddForm('update_event', 'ActionForm');
$this->_AddMapping( 'UpdateEvent', // Mapping Name
'UpdateEvent', // Class to Implement
APPL_BASE.'eventedit', // Default Location whence called
'update_event'); // form mapping
$this->_AddForward( 'UpdateEvent', // ActionMapping Identifier
'edit'); // Forward Name
}
/// VIEW ////////////////////////////
class UpdateEventView extends View
{
/**
* template
*/
var $_msTemplate = DETAIL_VIEW_TEMPLATE;
/**
* constructor function
* @return void
*/
function UpdateEventView()
{
}
/**
* assign data to Smarty in preperation for display
*
* @param object $poSmarty the smarty instance
* @return void
*/
function Prepare()
{
$event_id = (int)$this->_moForm->Get('event_id');
$detail = (int)$this->_moForm->Get('detail');
$this->_moTpl->Assign(array(
'title_extra' => 'Event Detail'
,'view' => 'event_detail'
,'debugging' => '1'
,'detail' => Events::GetDetail($event_id)
,'event_id' => $event_id
# ,'test' => var_export(Events::GetDetail(), true),
));
$this->_mbPrepared = true;
}
}
What am I doing wrong? I have a feeling it has something to do with the way I map ActionForms to Actions, but I can't figure it out. Thanks for your help!
Bookmarks