當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BaseForm類代碼示例

本文整理匯總了PHP中BaseForm的典型用法代碼示例。如果您正苦於以下問題:PHP BaseForm類的具體用法?PHP BaseForm怎麽用?PHP BaseForm使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了BaseForm類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render

 public function render(ddUploadify $up)
 {
     $widget_id = $this->getSlug() . '-input';
     $form = new BaseForm();
     $csrf_token = $form->getCSRFToken();
     $output = '<div class="container dd-img-upload-wrapper">';
     $output .= '<div id="fileQueue"></div>';
     $output .= '<input type="file" name="' . $up->getSlug() . '" id="' . $widget_id . '" />';
     $output .= '<p><a href="javascript:jQuery(\'#' . $widget_id . '\').uploadifyClearQueue()">Cancel All Uploads</a></p>';
     $output .= '<div class="swfupload-buttontarget">
     <noscript>
       We\'re sorry.  SWFUpload could not load.  You must have JavaScript enabled to enjoy SWFUpload.
     </noscript>
   </div>';
     $output .= '<script type="text/javascript">
     //<![CDATA[
     $(document).ready(function() {
       $(\'#' . $widget_id . ' \').uploadify({
         \'scriptData\': {\' ' . array_key($up->getSession()) . ' \': \' ' . array_value($up->getSession()) . ' \', \'_csrf_token\': \' ' . $csrf_token . ' \'},
         \'uploader\': \' ' . $up->getUploader() . ' \',
         \'cancelImg\': \'cancel.png\',
         \'auto\'      : true,
         \'script\': $(\'#' . $widget_id . '\').closest(\'form\').attr(\'action\')+\'/upload\',
         \'folder\': \'\',
         \'multi\': false,
         \'displayData\': \'speed \',
         \'fileDataName\': \' ' . $widget_id . ' \',
         \'simUploadLimit\': 2
       });
     });
     //]]>
   </script>';
     printf($output);
 }
開發者ID:ner0tic,項目名稱:scss,代碼行數:34,代碼來源:ddUploadifyRenderer.class.php

示例2: bind

 public function bind(array $taintedValues = null, array $taintedFiles = null)
 {
     $new_occurrences = new BaseForm();
     if (isset($taintedValues["EiBlockParams"])) {
         try {
             $formParams = $this->getEmbeddedForm("EiBlockParams");
         } catch (InvalidArgumentException $exc) {
             $formParams = null;
         }
     }
     if (isset($taintedValues['EiBlockParams'])) {
         foreach ($taintedValues['EiBlockParams'] as $key => $new_occurrence) {
             try {
                 if (isset($new_occurrence["id"]) && $new_occurrence["id"] == "") {
                     $blockParam = new EiBlockParam();
                     $blockParam->setEiVersionStructureParent($this->getObject());
                     $blockParam->setId($new_occurrence["id"]);
                     $blockParam->setEiVersionId($this->getObject()->getEiVersionId());
                     $occurrence_form = new EiBlockParamForm($blockParam);
                     $new_occurrences->embedForm($key, $occurrence_form);
                 } elseif ($formParams != null && ($subForm = $formParams->getEmbeddedForm($key))) {
                     $occurrence_form = new EiBlockParamForm($subForm->getObject());
                     $new_occurrences->embedForm($key, $occurrence_form);
                 }
             } catch (InvalidArgumentException $exc) {
                 // TODO: Traiter l'exception.
             }
         }
         $this->embedForm('EiBlockParams', $new_occurrences);
     } else {
         $this->embedForm("EiBlockParams", new BaseForm());
     }
     parent::bind($taintedValues, $taintedFiles);
 }
開發者ID:lendji4000,項目名稱:compose,代碼行數:34,代碼來源:EiBlockForm.class.php

示例3: getCommandForm

 protected function getCommandForm()
 {
     $form = new BaseForm();
     $form->setWidgetSchema(new sfWidgetFormSchema(array('dm_command' => new sfWidgetFormInputText())));
     $form->setValidatorSchema(new sfValidatorSchema(array('dm_command' => new sfValidatorString())));
     return $form;
 }
開發者ID:theolymp,項目名稱:diem,代碼行數:7,代碼來源:actions.class.php

示例4: getToken

 public static function getToken()
 {
     $form = new BaseForm();
     if ($form->isCSRFProtected()) {
         return $form->getCSRFToken();
     }
     return '';
 }
開發者ID:limitium,項目名稱:uberlov,代碼行數:8,代碼來源:CSRF.php

示例5: processForm

 private function processForm($params, BaseForm $form)
 {
     $form->bind($params);
     if ($form->isValid()) {
         $form->save();
         return true;
     }
     return false;
 }
開發者ID:te-koyama,項目名稱:openpne,代碼行數:9,代碼來源:actions.class.php

示例6: actionUpdate

 public function actionUpdate($id)
 {
     $model = $this->loadModel($id);
     $form = new BaseForm('docs.DocumentationForm', $model);
     $this->performAjaxValidation($model);
     if ($form->submitted() && $model->save()) {
         $this->redirect($model->manageUrl);
     }
     $this->render('update', array('form' => $form));
 }
開發者ID:nizsheanez,項目名稱:documentation,代碼行數:10,代碼來源:DocumentationAdminController.php

示例7: processSignInForm

 /**
  * @param BaseForm $form
  */
 public function processSignInForm(BaseForm $form)
 {
     $values = $form->getValues();
     $this->getUser()->setExpiration('+ 20 minutes', TRUE);
     try {
         $this->getUser()->login($values->email, $values->password);
     } catch (Nette\Security\AuthenticationException $e) {
         $form->addError($e->getMessage());
         return;
     }
     $this->redirect('Homepage:');
 }
開發者ID:tacoberu,項目名稱:nette-project,代碼行數:15,代碼來源:SignPresenter.php

示例8: bind

 public function bind(array $taintedValues = null, array $taintedFiles = null)
 {
     if (isset($taintedValues['new'])) {
         $new_stop_times = new BaseForm();
         foreach ($taintedValues['new'] as $key => $new_stop_time) {
             $stop_time = new NjStopTime();
             $stop_time->setNjTrip($this->getObject());
             $stop_time_form = new NjStopTimeForm($stop_time);
             $new_stop_times->embedForm($key, $stop_time_form);
         }
         $this->embedForm('new', $new_stop_times);
     }
     parent::bind($taintedValues, $taintedFiles);
 }
開發者ID:nvieirafelipe,項目名稱:graviola-project,代碼行數:14,代碼來源:NjTripForm.class.php

示例9: bind

 public function bind(array $taintedValues = null, array $taintedFiles = null)
 {
     $new_occurrences = new BaseForm();
     if (isset($taintedValues['kalParams'])) {
         foreach ($taintedValues['kalParams'] as $key => $new_occurrence) {
             $kalparam = new EiFunctionHasParam();
             $kalparam->setKalFunction($this->getObject());
             $occurrence_form = new EiFunctionHasParamForm($kalparam);
             $new_occurrences->embedForm($key, $occurrence_form);
         }
         $this->embedForm('kalParams', $new_occurrences);
     }
     parent::bind($taintedValues, $taintedFiles);
 }
開發者ID:lendji4000,項目名稱:compose,代碼行數:14,代碼來源:KalFunctionForm.class.php

示例10: bind

 public function bind(array $taintedValues = null, array $taintedFiles = null)
 {
     if (array_key_exists('new', $taintedValues)) {
         $new_occurrences = new BaseForm();
         foreach ($taintedValues['new'] as $key => $new_occurrence) {
             $occurrence = new UserSport();
             $occurrence->setSport($this->getObject());
             $occurrence_form = new UserSportForm($occurrence);
             $new_occurrences->embedForm($key, $occurrence_form);
         }
     }
     $this->embedForm('new', $new_occurrences);
     parent::bind($taintedValues, $taintedFiles);
 }
開發者ID:TheoJD,項目名稱:portail,代碼行數:14,代碼來源:SportForm.class.php

示例11: handleRequest

 /**
  *
  */
 public function handleRequest()
 {
     if ($this->_processForm()) {
         $result = array('r' => true, 'message' => $this->_form->successMessage);
         // добавляем к результату переменные от экшенов
         $result = array_merge($result, $this->_form->getActionResults());
         echo json_encode($result);
     } else {
         $this->_statusError('Ошибка при заполнении формы. Проверьте правильность заполнения всех обязательных полей');
     }
 }
開發者ID:petun,項目名稱:forms,代碼行數:14,代碼來源:Application.php

示例12: __construct

 /**
  * DOCUMENT ME
  * @param mixed $id
  * @param mixed $value
  * @param mixed $soptions
  */
 public function __construct($id, $value, $soptions)
 {
     $this->id = $id;
     $this->value = $value;
     $this->soptions = $soptions;
     parent::__construct();
 }
開發者ID:hashir,項目名稱:UoA,代碼行數:13,代碼來源:BaseaTextForm.class.php

示例13: __construct

 public function __construct($programId = NULL, $courseIds = NULL, $courseNumbers = NULL)
 {
     $this->programId = $programId;
     $this->courseIds = $courseIds;
     $this->courseNumbers = $courseNumbers;
     parent::__construct();
 }
開發者ID:eyumay,項目名稱:srms.psco,代碼行數:7,代碼來源:FrontendCourseChecklistPrerequisiteForm.class.php

示例14: __construct

 public function __construct($studentIdNamePairArray = NULL, $courseId = NULL, $gradeChoices = NULL)
 {
     $this->gradeChoices = $gradeChoices;
     $this->studentIdNamePairArray = $studentIdNamePairArray;
     $this->courseId = $courseId;
     parent::__construct();
 }
開發者ID:eyumay,項目名稱:srms.psco,代碼行數:7,代碼來源:FrontendGradeSubmissionForm.class.php

示例15: __construct

 public function __construct($registrationId = NULL, $studentId = NULL, $courseArray = NULL)
 {
     $this->registrationId = $registrationId;
     $this->studentId = $studentId;
     $this->courseArray = $courseArray;
     parent::__construct();
 }
開發者ID:eyumay,項目名稱:srms.psco,代碼行數:7,代碼來源:FrontendExemptionRequestForm.class.php


注:本文中的BaseForm類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。