本文整理汇总了PHP中Zend_Form::getValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form::getValue方法的具体用法?PHP Zend_Form::getValue怎么用?PHP Zend_Form::getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form
的用法示例。
在下文中一共展示了Zend_Form::getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loginAction
public function loginAction()
{
$configForm = $this->getInvokeArg('bootstrap')->getResource('configForm');
$loginForm = new \Zend_Form($configForm->login);
if ($this->getRequest()->isPost()) {
if ($loginForm->isValid($_POST)) {
try {
$auth = $this->getInvokeArg('bootstrap')->auth;
$auth->setIdentity($loginForm->getValue('login'))->setCredential($loginForm->getValue('password'));
$result = \Zend_Auth::getInstance()->authenticate($auth);
if ($result->isValid()) {
$this->_redirect('/admin');
} else {
$this->_helper->systemMessages('error', 'Anmeldung verweigert');
}
} catch (\Exception $e) {
$log = $this->getInvokeArg('bootstrap')->log;
$log->log($e->getMessage(), \Zend_Log::ERR, array('trace' => $e->getTraceAsString()));
$this->_helper->systemMessages('error', 'Fehler bei der Anmeldung');
}
}
}
$loginForm->setAction('/login');
$this->view->form = $loginForm;
}
示例2: setModel
public function setModel(Zend_Form $form, \Model\EmployeeTraining $model)
{
$em = EntityManager::getInstance();
$values = $form->getValue("basic");
$model->training = $em->find("Training", $values['training']);
$model->employee = $em->find("Employee", $form->getValue("parent"));
}
示例3: getPartnerFilterFromForm
private function getPartnerFilterFromForm(Zend_Form $form)
{
$filter = new KalturaPartnerFilter();
$filterType = $form->getValue('filter_type');
$filterInput = $form->getValue('filter_input');
$includeActive = $form->getValue('include_active');
$includeBlocked = $form->getValue('include_blocked');
$includeRemoved = $form->getValue('include_removed');
if ($filterType == 'byid') {
$filter->idIn = $filterInput;
} else {
if ($filterType == 'byname') {
$filter->nameLike = $filterInput;
} elseif ($filterType == 'free' && $filterInput) {
$filter->partnerNameDescriptionWebsiteAdminNameAdminEmailLike = $filterInput;
}
}
$statuses = array();
if ($includeActive) {
$statuses[] = KalturaPartnerStatus::ACTIVE;
}
if ($includeBlocked) {
$statuses[] = KalturaPartnerStatus::BLOCKED;
}
if ($includeRemoved) {
$statuses[] = KalturaPartnerStatus::FULL_BLOCK;
}
$filter->statusIn = implode(',', $statuses);
$filter->orderBy = KalturaPartnerOrderBy::ID_DESC;
return $filter;
}
示例4: setModel
public function setModel(Zend_Form $form, \Model\Renouncement $model)
{
$em = EntityManager::getInstance();
$values = $form->getValue("basic");
$model->documentSendDate = $values['document_send_date'];
$model->policyCreateDate = $values['policy_create_date'];
$model->policyNumber = $values['policy_number'];
$model->customer = $em->find("Customer", $form->getValue("parent"));
}
示例5: setModel
public function setModel(Zend_Form $form, \Model\CustomerHistory $model)
{
$em = EntityManager::getInstance();
$values = $form->getValue("basic");
$model->date = $values['date'];
$model->info = $values['info'];
$model->customer = $em->find("Customer", $form->getValue("parent"));
$model->instruction = $em->find("Instruction", $values['instruction']);
}
示例6: setModel
public function setModel(\Zend_Form $form, \Model\CustomerAddress $model)
{
$em = EntityManager::getInstance();
$values = $form->getValue("basic");
$model->city = $values['city'];
$model->postcode = $values['postcode'];
$model->state = $em->find("State", $values['state']);
$model->street = $values['street'];
$model->addressType = $values['address_type'];
$model->houseNumber = $values['house_number'];
$model->flatNumber = $values['flat_number'];
$model->customer = $em->find("Customer", $form->getValue("parent"));
}
示例7: bookingAction
/** THis is where they pick the duration */
function bookingAction()
{
$this->layout('layout/layout-appointment-summary');
$layoutViewModel = $this->layout();
$progress = new ViewModel(['step' => 3]);
$progress->setTemplate('application/progress');
$layoutViewModel->addChild($progress, 'progress');
$service = $this->serviceDataMapper()->find($this->params('service'));
$durations = array();
foreach ($service['durations'] as $duration) {
$durations[$duration] = $this->durationLabels[$duration];
}
$form = new \Zend_Form();
$form->addElement('radio', 'appointment_duration', array('label' => 'Appointment Duration', 'multiOptions' => $durations, 'separator' => ''));
if ($this->getRequest()->isPost() && $form->isValid($this->params()->fromPost())) {
$url = $this->url()->fromRoute('make-booking', array('action' => 'booking2', 'duration' => $form->getValue('appointment_duration'), 'service' => $this->params('service'), 'day' => $this->params('day')));
$this->redirect()->toUrl($url);
return;
}
$this->viewParams['form'] = $form;
$summary = new ViewModel($this->params()->fromRoute());
$summary->setTemplate('application/summary');
$layoutViewModel->addChild($summary, 'appointment_summary');
$viewModel = new ViewModel($this->viewParams);
$viewModel->setTemplate('application/booking');
return $viewModel;
}
示例8: indexAction
public function indexAction()
{
$session = new \Zend_Session_Namespace('twitter', true);
$oauthConfig = array('callbackUrl' => 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'], 'siteUrl' => 'http://twitter.com/oauth');
$configForm = $this->getInvokeArg('bootstrap')->getResource('configForm');
$twitterApiForm = new \Zend_Form($configForm->twitterApi);
if ($this->getRequest()->isPost()) {
if ($twitterApiForm->isValid($_POST)) {
try {
$this->twitterRepository->saveEntity($twitterApiForm->getValues());
$oauthConfig['consumerKey'] = $twitterApiForm->getValue('consumerKey');
$oauthConfig['consumerSecret'] = $twitterApiForm->getValue('consumerSecret');
$consumer = new \Zend_Oauth_Consumer($oauthConfig);
$token = $consumer->getRequestToken();
$session->twitterRequestToken = serialize($token);
$consumer->redirect();
} catch (\Exception $e) {
$log = $this->getInvokeArg('bootstrap')->log;
$log->log($e->getMessage(), \Zend_Log::ERR, array('trace' => $e->getTraceAsString()));
$this->_helper->systemMessages('error', 'Einstellungen konnte nicht gespeichert werden');
}
}
} else {
try {
$entity = $this->twitterRepository->fetchEntity();
if ($entity) {
if (isset($session->twitterRequestToken)) {
$oauthConfig['consumerKey'] = $entity->consumerKey;
$oauthConfig['consumerSecret'] = $entity->consumerSecret;
$consumer = new \Zend_Oauth_Consumer($oauthConfig);
$token = $consumer->getAccessToken($_GET, unserialize($session->twitterRequestToken));
$this->twitterRepository->saveEntity(array('accessToken' => serialize($token)));
unset($session->twitterRequestToken);
$this->_helper->systemMessages('notice', 'Einstellungen erfolgreich gespeichert');
}
$twitterApiForm->populate($entity->toArray());
}
} catch (\Exception $e) {
$log = $this->getInvokeArg('bootstrap')->log;
$log->log($e->getMessage(), \Zend_Log::ERR, array('trace' => $e->getTraceAsString()));
$this->_helper->systemMessages('error', 'Einstellungen konnte nicht gespeichert werden');
}
}
$twitterApiForm->setAction('/admin/twitter');
$this->view->form = $twitterApiForm;
}
示例9: setModel
public function setModel(Zend_Form $form, \Model\InstitutionProduct $model)
{
$em = EntityManager::getInstance();
$values = $form->getValue("basic");
$model->name = $values['name'];
$model->active = $values['active'];
$model->institution = $em->find("Institution", $values['institution']);
}
示例10: save
private function save(Zend_Form $form)
{
$id = (int) $form->getValue('id');
$category = new GC\Entity\Category(array('id' => $id));
if ($id != 0) {
$category = $this->_em->find('GC\\Entity\\Category', $id);
}
$category->populate($form->getValues());
$this->_em->getRepository('GC\\Entity\\Category')->save($category);
}
示例11: setModel
public function setModel(Zend_Form $form, \Model\CustomerCredit $model)
{
$em = EntityManager::getInstance();
$values = $form->getValue("basic");
$model->amount = $values['amount'];
$model->balance = $values['balance'];
$model->balanceDate = $values['balance_date'];
$model->bank = $values['bank'];
$model->conclusionDateStart = $values['conclusion_date_start'];
$model->costOfRepayment = $values['cost_of_repayment'];
$model->currency = $em->find("Currency", $values['currency']);
$model->currencyRate = $values['currency_rate'];
$model->installment = $values['installment'];
$model->periodInMonths = $values['period_in_months'];
$model->type = $em->find("CreditType", $values["type"]);
$model->margin = $values['margin'];
$model->rrso = $values['rrso'];
$model->customer = $em->find("Customer", $form->getValue("parent"));
}
示例12: setModel
public function setModel(Zend_Form $form, \Model\CustomerOldProduct $model)
{
$em = EntityManager::getInstance();
$values = $form->getValue("basic");
$model->institution = $em->find("Institution", $values['institution']);
$model->institutionProduct = $em->find("InstitutionProduct", $values['institution_product']);
$model->instruction = $em->find("Instruction", $values['instruction']);
$model->insuranceSum = $values['insurance_sum'];
$model->insuranceSumNnw = $values['insurance_sum_nnw'];
$model->insuranceSumNkw = $values['insurance_sum_nkw'];
$model->conclusionDateStart = $values['conclusion_date_start'];
$model->conclusionDateEnd = $values['conclusion_date_end'];
$model->fee = $values['fee'];
$model->premiumType = $em->find("PremiumType", $values['premium_type']);
$model->contribution = $values['contribution'];
$model->amount = $values['amount'];
$model->productCreateDate = $values['create_date'];
$model->policyNumber = $values['policy_number'];
$model->description = $values['description'];
$model->customer = $em->find("Customer", $form->getValue("parent"));
}
示例13: setPolicy
public function setPolicy(\Zend_Form $form, \Model\Policy $policy, \Model\Application $application)
{
$em = EntityManager::getInstance();
$values = $form->getValue("policy");
$policy->application = $application;
$policy->outerNumber = $values['policy_outer_number'];
$policy->createDate = $values['policy_create_date'];
$policy->endDate = $values['policy_end_date'];
$policy->popPlace = $values['policy_pop_place'];
$policy->deliveryDate = $values['policy_delivery_date'];
$policy->popReturnDate = $values['policy_pop_return_date'];
}
示例14: setModel
public function setModel(\Zend_Form $form, \Model\Shipment $model)
{
$em = EntityManager::getInstance();
$values = $form->getValue("basic");
$model->createDate = date("Y-m-d H:i:s");
$model->street = $values['street'];
$model->email = $values['email'];
$model->city = $values['city'];
$model->postcode = $values['postcode'];
$model->state = $em->find("State", $values['state']);
$model->type = $em->find("ShipmentType", $values['type']);
$model->phoneNumber = $values['phone_number'];
}
示例15: testGetValueCanReturnSubFormValuesFromArrayToWhichElementsBelong
public function testGetValueCanReturnSubFormValuesFromArrayToWhichElementsBelong()
{
$subForm = new Zend_Form_SubForm();
$subForm->addElements(array('foo' => 'text', 'bar' => 'text'))->setElementsBelongTo('subform');
$subForm->foo->setValue('foo value');
$subForm->bar->setValue('bar value');
$this->form->addSubForm($subForm, 'page1');
$values = $this->form->getValue('subform');
$this->assertTrue(isset($values['foo']), var_export($values, 1));
$this->assertTrue(isset($values['bar']));
$this->assertEquals($subForm->foo->getValue(), $values['foo']);
$this->assertEquals($subForm->bar->getValue(), $values['bar']);
}