"ezcappContactActionList", "show" => "ezcappContactActionShow", "create" => "ezcappContactActionCreate", "delete" => "ezcappContactActionDelete", "addemail" => "ezcappContactActionAddEmail", "deleteemail" => "ezcappContactActionDeleteEmail", "showemail" => "ezcappContactActionShowEmail", "createaddress" => "ezcappContactActionCreateAddress", "addaddress" => "ezcappContactActionAddAddress", "removeaddress" => "ezcappContactActionRemoveAddress", "listaddresses" => "ezcappContactActionListAddresses", ); private $currentAction; public function __construct() { $db = ezcDbFactory::create( DSN ); ezcDbInstance::set( $db ); $session = new ezcPersistentSession( $db, new ezcPersistentCodeManager( dirname( __FILE__ ) . "/persistent" ) ); ezcPersistentSessionInstance::set( $session ); $config = ezcTemplateConfiguration::getInstance(); $config->templatePath = dirname( __FILE__ ) . "/templates"; $config->compilePath = dirname( __FILE__ ) . "/templatesc"; } public function run() { $action = 'list'; if ( ezcInputForm::hasGetData() ) { $definition = array( 'action' => new ezcInputFormDefinitionElement( ezcInputFormDefinitionElement::REQUIRED, 'string' ), ); $form = new ezcInputForm( INPUT_GET, $definition ); $action = ( $form->hasValidData( 'action' ) ) ? $form->action : $action; } $actionClass = $this->actions[$action]; $actionObject = new $actionClass; $actionObject->run(); $template = new ezcTemplate(); $template->send->action = $actionObject; echo $template->process( $actionObject->getTemplate() . ".ezt" ); } } $contact = new ezcappContact(); $contact->run(); ?>