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

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

This method overrides the parent implementation with additional file update control specific attributes.
protected addAttributesToRender ( $writer )
    protected function addAttributesToRender($writer)
    {
        $this->getPage()->ensureRenderInForm($this);
        parent::addAttributesToRender($writer);
        $writer->addAttribute('type', 'file');
        $writer->addAttribute('name', $this->getUniqueID());
        $isEnabled = $this->getEnabled(true);
        if (!$isEnabled && $this->getEnabled()) {
            // in this case parent will not render 'disabled'
            $writer->addAttribute('disabled', 'disabled');
        }
    }

Usage Example

Пример #1
0
 /**
  * Adds ID attribute, and renders the javascript for active component.
  * @param THtmlWriter the writer used for the rendering purpose
  */
 public function addAttributesToRender($writer)
 {
     parent::addAttributesToRender($writer);
     $writer->addAttribute('id', $this->getClientID());
     $this->getPage()->getClientScript()->registerPradoScript('activefileupload');
     $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getClientOptions());
 }