本文整理汇总了PHP中HtmlObject\Element::src方法的典型用法代码示例。如果您正苦于以下问题:PHP Element::src方法的具体用法?PHP Element::src怎么用?PHP Element::src使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlObject\Element
的用法示例。
在下文中一共展示了Element::src方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: content
public static function content(ContentBlockController $controller)
{
$content = $controller->getSearchableContent();
$dom = new HtmlDomParser();
$r = $dom->str_get_html($content, true, true, DEFAULT_TARGET_CHARSET, false);
if (is_object($r)) {
foreach ($r->find('concrete-picture') as $picture) {
$fID = $picture->fid;
$fo = File::getByID($fID);
if (is_object($fo)) {
$tag = new AmpImg($fo);
$tag->alt($picture->alt);
$picture->outertext = (string) $tag;
}
}
foreach ($r->find('img') as $img) {
$tag = new Element('amp-img');
$tag->alt($img->alt);
$tag->src($img->src);
$tag->height($img->height);
$tag->width($img->width);
$img->outertext = (string) $tag;
}
foreach ($r->find('*[style]') as $element) {
$element->removeAttribute('style');
}
$content = (string) $r->restore_noise($r);
}
$content = LinkAbstractor::translateFrom($content);
return $content;
}
示例2: getPageTypeComposerControlIcon
public function getPageTypeComposerControlIcon()
{
if (isset($this->ptComposerControlIconSRC)) {
$img = new Element('img');
$img->src($this->ptComposerControlIconSRC);
return $img;
} else {
return $this->ptComposerControlIconFormatter->getListIconElement();
}
}