本文整理汇总了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);
}
示例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);
}
示例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;
}
示例4: getToken
public static function getToken()
{
$form = new BaseForm();
if ($form->isCSRFProtected()) {
return $form->getCSRFToken();
}
return '';
}
示例5: processForm
private function processForm($params, BaseForm $form)
{
$form->bind($params);
if ($form->isValid()) {
$form->save();
return true;
}
return false;
}
示例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));
}
示例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:');
}
示例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);
}
示例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);
}
示例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);
}
示例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('Ошибка при заполнении формы. Проверьте правильность заполнения всех обязательных полей');
}
}
示例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();
}
示例13: __construct
public function __construct($programId = NULL, $courseIds = NULL, $courseNumbers = NULL)
{
$this->programId = $programId;
$this->courseIds = $courseIds;
$this->courseNumbers = $courseNumbers;
parent::__construct();
}
示例14: __construct
public function __construct($studentIdNamePairArray = NULL, $courseId = NULL, $gradeChoices = NULL)
{
$this->gradeChoices = $gradeChoices;
$this->studentIdNamePairArray = $studentIdNamePairArray;
$this->courseId = $courseId;
parent::__construct();
}
示例15: __construct
public function __construct($registrationId = NULL, $studentId = NULL, $courseArray = NULL)
{
$this->registrationId = $registrationId;
$this->studentId = $studentId;
$this->courseArray = $courseArray;
parent::__construct();
}