コード例 #1
0
ファイル: EditForm.php プロジェクト: alnutile/drunatra
 /**
  * {@inheritdoc}
  */
 public function buildForm(array $form, array &$form_state, $pid = NULL)
 {
     $form = parent::buildForm($form, $form_state, $pid);
     $form['#title'] = String::checkPlain($this->path['alias']);
     $form['pid'] = array('#type' => 'hidden', '#value' => $this->path['pid']);
     $form['actions']['delete'] = array('#type' => 'submit', '#value' => $this->t('Delete'), '#submit' => array(array($this, 'deleteSubmit')));
     return $form;
 }
コード例 #2
0
ファイル: EditForm.php プロジェクト: ddrozdik/dmaps
 /**
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state, $pid = NULL)
 {
     $form = parent::buildForm($form, $form_state, $pid);
     $form['#title'] = $this->path['alias'];
     $form['pid'] = array('#type' => 'hidden', '#value' => $this->path['pid']);
     $form['actions']['delete'] = array('#type' => 'submit', '#value' => $this->t('Delete'), '#submit' => array('::deleteSubmit'));
     return $form;
 }
コード例 #3
0
ファイル: EditForm.php プロジェクト: eigentor/tommiblog
 /**
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state, $pid = NULL)
 {
     $form = parent::buildForm($form, $form_state, $pid);
     $form['#title'] = $this->path['alias'];
     $form['pid'] = array('#type' => 'hidden', '#value' => $this->path['pid']);
     $url = new Url('path.delete', array('pid' => $this->path['pid']));
     if ($this->getRequest()->query->has('destination')) {
         $url->setOption('query', $this->getDestinationArray());
     }
     $form['actions']['delete'] = array('#type' => 'link', '#title' => $this->t('Delete'), '#url' => $url, '#attributes' => array('class' => array('button', 'button--danger')));
     return $form;
 }