public function setDocType($docType) { if ($docType == self::HTML_4_STRICT || $docType == self::HTML_4_TRANSITIONAL || $docType == self::HTML_4_FRAMESET || $docType == self::HTML_5 || $docType == self::XHTML_1_STRICT || $docType == self::XHTML_1_TRANSITIONAL || $docType == self::XHTML_1_FRAMESET) { $this->docType = $docType; $this->xml = NHtml::$xhtml = $docType == self::XHTML_1_STRICT || $docType == self::XHTML_1_TRANSITIONAL || $docType == self::XHTML_1_FRAMESET; } else { throw new InvalidArgumentException("Doctype {$docType} is not supported."); } return $this; //fluent interface }
/** * Generating */ public function generate() { // Sets Xhtml or Html if ($this->isXhtml()) { NHtml::$xhtml = TRUE; } else { NHtml::$xhtml = FALSE; } // inic $output = NULL; // start tag if ($this->copyright()) { $output .= "<!-- @FbTools: OpenGraphTags -->\n"; } // OG TAGS $output .= $this->makeTag('og:title', $this->getTitle()); $output .= $this->makeTag('og:type', $this->getType()); $output .= $this->makeTag('og:url', $this->getUrl()); $output .= $this->makeTag('og:image', $this->getImage()); $output .= $this->makeTag('og:site_name', $this->getSiteName()); $output .= $this->makeTag('fb:admins', $this->getAppId()); // end tag if ($this->copyright) { $output .= "<!-- /@FbTools: OpenGraphTags -->\n"; } echo $output; }
public function generate() { if ($this->isXhtml()) { NHtml::$xhtml = true; } else { NHtml::$xhtml = false; } // inic $output = null; // start tag if ($this->writeCopyrightTags()) { $output .= "<!-- @FbTools: OpenGraphTags --!>\n"; } // og tags //title $output .= $this->generateTitle($this->getTitle()); //type $output .= $this->generateType($this->getType()); //url $output .= $this->generateUrl($this->getUrl()); //image $output .= $this->generateImage($this->getImage()); //site_name $output .= $this->generateSiteName($this->getSiteName()); //admins $output .= $this->generateAdmins($this->getAppId()); // end tag if ($this->writeCopyrightTags()) { $output .= "<!-- /@FbTools: OpenGraphTags --!>\n"; } echo $output; }