Nette\Forms\Controls\BaseControl::setAttribute PHP 메소드

setAttribute() 공개 메소드

Changes control's HTML attribute.
public setAttribute ( $name, $value = TRUE ) : self
리턴 self
    public function setAttribute($name, $value = TRUE)
    {
        $this->control->{$name} = $value;
        return $this;
    }

Usage Example

예제 #1
0
파일: Filter.php 프로젝트: ublaboo/datagrid
 /**
  * @param Nette\Forms\Controls\BaseControl $input
  * @return Nette\Forms\Controls\BaseControl
  */
 protected function addAttributes($input)
 {
     if ($this->grid->hasAutoSubmit()) {
         $input->setAttribute('data-autosubmit', TRUE);
     } else {
         $input->setAttribute('data-datagrid-manualsubmit', TRUE);
     }
     foreach ($this->attributes as $attribute) {
         $input->setAttribute($attribute[0], $attribute[1]);
     }
     return $input;
 }
All Usage Examples Of Nette\Forms\Controls\BaseControl::setAttribute