本文整理汇总了PHP中BaseForm类的典型用法代码示例。如果您正苦于以下问题:PHP BaseForm类的具体用法?PHP BaseForm怎么用?PHP BaseForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BaseForm类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: configure
public function configure()
{
parent::configure();
$this->setWidget('username_or_email', new sfWidgetFormInput(array(), array('maxlength' => 100)));
$this->setValidator('username_or_email', new sfValidatorOr(array(new sfValidatorAnd(array(new sfValidatorString(array('required' => true, 'trim' => true, 'min_length' => 4, 'max_length' => 16)), new sfValidatorDoctrineChoice(array('model' => 'sfGuardUser', 'column' => 'username'), array("invalid" => "There is no such user.")))), new sfValidatorEmail(array('required' => true)))));
$this->widgetSchema->setNameFormat('sfApplyResetRequest[%s]');
}
开发者ID:alex1818,项目名称:TestReportCenter,代码行数:7,代码来源:BasesfApplyResetRequestForm.class.php
示例17: configure
public function configure()
{
$this->widgetSchema['query'] = new sfWidgetFormInputText();
$this->validatorSchema['query'] = new sfValidatorString(array('required' => true));
$this->widgetSchema->setLabels(array('query' => 'Запрос'));
parent::configure();
}
开发者ID:limitium,项目名称:uberlov,代码行数:7,代码来源:SearchForm.php
示例18: embedForm
/**
* Moves button below embedded forms
* @inheritdoc
* @param string $name
* @param sfForm $form
* @param string $decorator
*/
public function embedForm($name, sfForm $form, $decorator = null)
{
parent::embedForm($name, $form, $decorator);
if ($this->getOption('addByCloning')) {
$this->widgetSchema->moveField('_', sfWidgetFormSchema::LAST);
}
}
开发者ID:koto,项目名称:ahDoctrineEasyEmbeddedRelationsPlugin,代码行数:14,代码来源:ahNewRelationsContainerForm.php
示例19: setup
public function setup()
{
$this->widgetSchema['email_address'] = new sfWidgetFormInputText();
$this->validatorSchema['email_address'] = new sfGuardValidatorUsernameOrEmail(array('trim' => true), array('required' => 'Your username or e-mail address is required.', 'invalid' => 'Username or e-mail address not found please try again.'));
$this->widgetSchema->setNameFormat('forgot_password[%s]');
parent::setup();
}
开发者ID:streamlinesocial,项目名称:sfDoctrineGuardPlugin,代码行数:7,代码来源:BasesfGuardRequestForgotPasswordForm.class.php
示例20: __construct
public function __construct($enrollments = NULL, $courses = NULL, $gradeChoices = NULL)
{
$this->gradeChoices = $gradeChoices;
$this->enrollments = $enrollments;
$this->courses = $courses;
parent::__construct();
}
开发者ID:eyumay,项目名称:srms.psco,代码行数:7,代码来源:FrontendGradeForm.class.php
注:本文中的BaseForm类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论