PHPHtmlParser\Dom\Tag::setEncoding PHP Method

setEncoding() public method

Sets the encoding type to be used.
public setEncoding ( stringEncode\Encode $encode )
$encode stringEncode\Encode
    public function setEncoding(Encode $encode)
    {
        $this->encode = $encode;
    }

Usage Example

Example #1
0
 /** 
  * Sets the encoding class to this node and propagates it
  * to all its children.
  *
  * @param Encode $encode
  */
 public function propagateEncoding(Encode $encode)
 {
     $this->encode = $encode;
     $this->tag->setEncoding($encode);
     // check children
     foreach ($this->children as $id => $child) {
         $child['node']->propagateEncoding($encode);
     }
 }
All Usage Examples Of PHPHtmlParser\Dom\Tag::setEncoding