当前位置: 首页>>代码示例>>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;未经允许,请勿转载。