Prado\Web\UI\WebControls\TStyle::mergeWith PHP Метод

mergeWith() публичный Метод

If a style field is not set in this style, it will be overwritten by the new one.
public mergeWith ( $style )
    public function mergeWith($style)
    {
        if ($style instanceof TStyle) {
            $this->_fields = array_merge($style->_fields, $this->_fields);
            if ($this->_class === null) {
                $this->_class = $style->_class;
            }
            if ($this->_customStyle === null) {
                $this->_customStyle = $style->_customStyle;
            }
            if ($style->_font !== null) {
                $this->getFont()->mergeWith($style->_font);
            }
        }
    }

Usage Example

 /**
  * Merges the style with a new one.
  * If a style field is not set in this style, it will be overwritten by
  * the new one.
  * @param TStyle the new style
  */
 public function mergeWith($style)
 {
     parent::mergeWith($style);
     if ($style instanceof TWizardNavigationButtonStyle) {
         if ($style->_imageUrl !== null) {
             $this->_imageUrl = $style->_imageUrl;
         }
         if ($style->_buttonText !== null) {
             $this->_buttonText = $style->_buttonText;
         }
         if ($style->_buttonType !== null) {
             $this->_buttonType = $style->_buttonType;
         }
     }
 }
All Usage Examples Of Prado\Web\UI\WebControls\TStyle::mergeWith