本文整理汇总了PHP中Drupal\Core\Form\FormStateInterface::setRedirectUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP FormStateInterface::setRedirectUrl方法的具体用法?PHP FormStateInterface::setRedirectUrl怎么用?PHP FormStateInterface::setRedirectUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\Core\Form\FormStateInterface
的用法示例。
在下文中一共展示了FormStateInterface::setRedirectUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* {@inheritdoc}
*/
public function save(array $form, FormStateInterface $form_state)
{
$entity = $this->entity;
$status = $entity->save();
switch ($status) {
case SAVED_NEW:
drupal_set_message($this->t('Created %label.', ['%label' => $entity->label()]));
$form_state->setRedirectUrl($entity->toUrl('edit-form'));
break;
default:
drupal_set_message($this->t('Saved %label.', ['%label' => $entity->label()]));
$form_state->setRedirectUrl($entity->toUrl('collection'));
break;
}
}
示例2: submitForm
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state)
{
$component = $this->rulesUiHandler->getComponent();
$component->getExpression()->deleteExpression($this->uuid);
$this->rulesUiHandler->updateComponent($component);
$form_state->setRedirectUrl($this->getCancelUrl());
}
示例3: submitForm
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state)
{
$this->page->removeAccessCondition($this->accessCondition->getConfiguration()['uuid']);
$this->page->save();
drupal_set_message($this->t('The access condition %name has been removed.', ['%name' => $this->accessCondition->getPluginDefinition()['label']]));
$form_state->setRedirectUrl($this->getCancelUrl());
}
示例4: submit
/**
* {@inheritdoc}
*/
public function submit(array $form, FormStateInterface $form_state)
{
$this->entity->delete();
$this->logger('user')->notice('Role %name has been deleted.', array('%name' => $this->entity->label()));
drupal_set_message($this->t('Role %name has been deleted.', array('%name' => $this->entity->label())));
$form_state->setRedirectUrl($this->getCancelUrl());
}
示例5: submitForm
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state)
{
$this->page->removeVariant($this->displayVariant->id());
$this->page->save();
drupal_set_message($this->t('The display variant %name has been removed.', ['%name' => $this->displayVariant->label()]));
$form_state->setRedirectUrl($this->getCancelUrl());
}
示例6: submit
/**
* {@inheritdoc}
*/
public function submit(array $form, FormStateInterface $form_state)
{
$this->entity->delete();
drupal_set_message(t('Custom block type %label has been deleted.', array('%label' => $this->entity->label())));
$this->logger('block_content')->notice('Custom block type %label has been deleted.', array('%label' => $this->entity->label()));
$form_state->setRedirectUrl($this->getCancelUrl());
}
示例7: submitForm
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state)
{
$this->getEntity()->delete();
$this->logger->info('Payment status %label (@id) has been deleted.', ['@id' => $this->getEntity()->id(), '%label' => $this->getEntity()->label()]);
drupal_set_message($this->t('%label has been deleted.', array('%label' => $this->getEntity()->label())));
$form_state->setRedirectUrl($this->getEntity()->urlInfo('collection'));
}
示例8: submitForm
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state)
{
$this->entity->delete();
\Drupal::service('router.builder')->setRebuildNeeded();
drupal_set_message($this->t('Signup Form %label has been deleted.', array('%label' => $this->entity->label())));
$form_state->setRedirectUrl($this->getCancelUrl());
}
示例9: submitForm
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state)
{
$currency_locale = $this->getEntity();
$currency_locale->delete();
drupal_set_message($this->t('The currency locale %label has been deleted.', array('%label' => $currency_locale->label())));
$form_state->setRedirectUrl($this->getCancelUrl());
}
示例10: submit
/**
* {@inheritdoc}
*/
public function submit(array $form, FormStateInterface $form_state)
{
$this->entity->delete();
drupal_set_message($this->t('Deleted vocabulary %name.', array('%name' => $this->entity->label())));
$this->logger('taxonomy')->notice('Deleted vocabulary %name.', array('%name' => $this->entity->label()));
$form_state->setRedirectUrl($this->getCancelUrl());
}
示例11: submitForm
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state)
{
if (mailchimp_campaign_delete_campaign($this->entity)) {
drupal_set_message($this->t('MailChimp Campaign %label has been deleted.', array('%label' => $this->entity->label())));
}
$form_state->setRedirectUrl($this->getCancelUrl());
}
示例12: save
/**
* {@inheritdoc}
*/
public function save(array $form, FormStateInterface $form_state)
{
$this->termStorage->resetWeights($this->entity->id());
drupal_set_message($this->t('Reset vocabulary %name to alphabetical order.', array('%name' => $this->entity->label())));
$this->logger('taxonomy')->notice('Reset vocabulary %name to alphabetical order.', array('%name' => $this->entity->label()));
$form_state->setRedirectUrl($this->entity->urlInfo('edit-form'));
}
示例13: submitForm
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state)
{
$entity = $this->getEntity();
$entity->delete();
\Drupal::logger('eck')->notice('@type: deleted %title.', array('@type' => $this->entity->bundle(), '%title' => $this->entity->label()));
$form_state->setRedirectUrl(new Url('eck.entity.' . $this->entity->getEntityTypeId() . '.list'));
}
示例14: submitForm
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
// Handle current blocks according to user's selection.
if ($blocks = $this->getBlocksForGroup()) {
$blocks_op = $form_state->getValue('blocks_op');
switch ($blocks_op) {
case static::DELETE_BLOCKS:
$this->blockStorage()->delete($blocks);
break;
case static::UNSET_BLOCKS:
$this->setBlocksGroup($blocks);
break;
default:
$this->setBlocksGroup($blocks, $blocks_op);
}
}
$this->entity->delete();
drupal_set_message(
$this->t('Deleted @type: @label.',
[
'@type' => $this->entity->getEntityType()->getLabel(),
'@label' => $this->entity->label(),
]
)
);
$form_state->setRedirectUrl($this->getCancelUrl());
}
示例15: submitForm
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state)
{
$this->entity->set('replacementID', $form_state->getValue('replacement'));
$this->entity->delete();
drupal_set_message($this->t('Style %name was deleted.', array('%name' => $this->entity->label())));
$form_state->setRedirectUrl($this->getCancelUrl());
}