コード例 #1
0
 /**
  * Renders this button.
  * @return string the rendering result.
  */
 public function render()
 {
     if (isset(self::$coreTypes[$this->type])) {
         return $this->renderCore();
     } else {
         return parent::render();
     }
 }
コード例 #2
0
 /**
  * Returns this button.
  * @return string the rendering result
  */
 public function render()
 {
     if (!isset($this->attributes['class'])) {
         $this->attributes['class'] = '';
     }
     $this->attributes['class'] .= ' btn';
     return parent::render();
 }
コード例 #3
0
 public function render()
 {
     $method = $this->type;
     if (strpos($this->type, 'ajax') === 0) {
         if (!isset($this->attributes['value'])) {
             throw new CException('Ajax кнопки должны иметь параметр value');
         }
         if (!isset($this->attributes['url'])) {
             throw new CException('Ajax кнопки должны иметь параметр url');
         }
         $htmlOptions = isset($this->attributes['htmlOptions']) ? $this->attributes['htmlOptions'] : array();
         $ajaxOptions = isset($this->attributes['ajaxOptions']) ? $this->attributes['ajaxOptions'] : array();
         return CHtml::$method($this->attributes['value'], $this->attributes['url'], $ajaxOptions, $htmlOptions);
     } else {
         return parent::render();
     }
 }