[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/view/form/control/ -> AphrontFormSubmitControl.php (source)

   1  <?php
   2  
   3  final class AphrontFormSubmitControl extends AphrontFormControl {
   4  
   5    private $cancelButton;
   6  
   7    public function addCancelButton($href, $label = null) {
   8      if (!$label) {
   9        $label = pht('Cancel');
  10      }
  11  
  12      $this->cancelButton = phutil_tag(
  13        'a',
  14        array(
  15          'href' => $href,
  16          'class' => 'button grey',
  17        ),
  18        $label);
  19      return $this;
  20    }
  21  
  22    protected function getCustomControlClass() {
  23      return 'aphront-form-control-submit';
  24    }
  25  
  26    protected function renderInput() {
  27      $submit_button = null;
  28      if ($this->getValue()) {
  29        $submit_button = phutil_tag(
  30          'button',
  31          array(
  32            'type'      => 'submit',
  33            'name'      => '__submit__',
  34            'disabled'  => $this->getDisabled() ? 'disabled' : null,
  35          ),
  36          $this->getValue());
  37      }
  38  
  39      return array(
  40        $submit_button,
  41        $this->cancelButton,
  42      );
  43    }
  44  
  45  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1