本文整理汇总了PHP中Venne\Forms\Form::getValues方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::getValues方法的具体用法?PHP Form::getValues怎么用?PHP Form::getValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Venne\Forms\Form
的用法示例。
在下文中一共展示了Form::getValues方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleSave
public function handleSave(Form $form)
{
$values = $form->getValues();
if ($values['api']['keyFile']->isOk()) {
$values['api']['keyFile']->move($this->googleanalyticsDir . '/key.p12');
}
unset($form['api']['keyFile']);
unset($form['api']['keyFileNew']);
}
示例2: handleSave
public function handleSave(Form $form)
{
/** @var $entity CategoryEntity */
$entity = $form->data;
$data = $form->getValues();
$sort = json_decode($data['sort'], TRUE);
foreach ($entity->getItems() as $photo) {
if (($pos = array_search($photo->id, $sort)) !== false) {
$photo->position = $pos;
}
}
parent::handleSave($form);
}
示例3: handleSave
public function handleSave(Form $form)
{
/** @var $entity CategoryEntity */
$entity = $form->data;
$data = $form->getValues();
foreach ($data['_photos'] as $fileEntity) {
if ($fileEntity) {
$entity->items[] = $photoEntity = new ItemEntity($form->data->extendedPage);
$photoEntity->route->setPhoto($fileEntity);
$photoEntity->route->setParent($entity->route);
$photoEntity->setCategory($entity);
}
}
parent::handleSave($form);
}
示例4: processForm
public function processForm(Form $form)
{
$this->tryCall('handleClear', array());
$values = $form->getValues();
if ($values['section'] === 'all') {
$this->cacheManager->clean();
} elseif ($values['section'] === 'namespace') {
try {
$this->cacheManager->cleanNamespace($values['namespace']);
} catch (InvalidArgumentException $e) {
$this->flashMessage($e->getMessage(), 'warning');
return;
}
} elseif ($values['section'] === 'sessions') {
$this->cacheManager->cleanSessions();
}
$this->flashMessage($this->translator->translate('Cache has been cleared.'), 'success');
if (!$this->isAjax()) {
$this->redirect('this');
}
}
示例5: formSuccess
public function formSuccess(Form $form)
{
$values = $form->getValues();
$button = $form->isSubmitted();
if ($values->remember) {
$form->presenter->user->setExpiration('+ 14 days', FALSE);
} else {
$form->presenter->user->setExpiration('+ 20 minutes', TRUE);
}
if ($button === $form->getSaveButton()) {
try {
$form->presenter->user->login($values->username, $values->password);
} catch (AuthenticationException $e) {
$this->onError($this, $e->getMessage());
}
} else {
$this->redirect('login!', str_replace('_', ' ', $button->name));
}
$this->onSuccess($this);
$this->redirect('this');
}
示例6: handleSuccess
public function handleSuccess(Form $form)
{
$values = $form->getValues();
$oldPath = $this->moduleHelpers->expandPath($form->data, 'Resources/layouts');
$form->data = $this->getKeyByValues($values);
$path = $this->moduleHelpers->expandPath($form->data, 'Resources/layouts');
umask(00);
if (!file_exists(dirname($path))) {
if (!@mkdir(dirname($path), 0777, TRUE)) {
$form->addError("File '{$path}' is not writable.");
}
}
file_put_contents($path, $values['text']);
if ($oldPath && $oldPath !== $path) {
@unlink($oldPath);
}
}