addElement('text', 'list_name', array( 'label' => $this->translate('List name') )); $this->addElement('hidden', 'owner'); } public function onSuccess() { $this->getElement('owner')->setValue( self::username() ); parent::onSuccess(); } protected static function username() { $auth = Auth::getInstance(); if ($auth->isAuthenticated()) { return $auth->getUser()->getUsername(); } else { return ''; } } }