Prado\Web\UI\WebControls\TWebControl::addAttributesToRender PHP Метод

addAttributesToRender() защищенный Метод

By default, the method will render 'id', 'accesskey', 'disabled', 'tabindex', 'title' and all custom attributes. The method can be overriden to provide customized attribute rendering.
protected addAttributesToRender ( $writer )
    protected function addAttributesToRender($writer)
    {
        if ($this->getID() !== '' || $this->getEnsureId()) {
            $writer->addAttribute('id', $this->getClientID());
        }
        if (($accessKey = $this->getAccessKey()) !== '') {
            $writer->addAttribute('accesskey', $accessKey);
        }
        if (!$this->getEnabled()) {
            $writer->addAttribute('disabled', 'disabled');
        }
        if (($tabIndex = $this->getTabIndex()) > 0) {
            $writer->addAttribute('tabindex', "{$tabIndex}");
        }
        if (($toolTip = $this->getToolTip()) !== '') {
            $writer->addAttribute('title', $toolTip);
        }
        if ($style = $this->getViewState('Style', null)) {
            $style->addAttributesToRender($writer);
        }
        if ($this->getHasAttributes()) {
            foreach ($this->getAttributes() as $name => $value) {
                $writer->addAttribute($name, $value);
            }
        }
    }

Usage Example

Пример #1
0
 /**
  * Adds attributes to renderer.
  * @param THtmlWriter the renderer
  * @throws TInvalidDataValueException if associated control cannot be found using the ID
  */
 protected function addAttributesToRender($writer)
 {
     if ($this->_forControl !== '') {
         $writer->addAttribute('for', $this->_forControl);
     }
     parent::addAttributesToRender($writer);
 }
All Usage Examples Of Prado\Web\UI\WebControls\TWebControl::addAttributesToRender