本文整理匯總了PHP中Parsedown::inlineImage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Parsedown::inlineImage方法的具體用法?PHP Parsedown::inlineImage怎麽用?PHP Parsedown::inlineImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Parsedown
的用法示例。
在下文中一共展示了Parsedown::inlineImage方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: inlineImage
/**
* Overload the function to either return nothing (if image image rendering is disable) or return the
* rendered image by calling the Parsedown function
*
* @param string $Excerpt The excerpt of text to be processed as an image
*
* @return array|null|void
*/
protected function inlineImage($Excerpt)
{
if ($this->allowImages) {
return parent::inlineImage($Excerpt);
}
return null;
}
示例2: inlineImage
/**
* Resolve inline images relative URLs to the module's path
*
* @param $Excerpt
* @return array|void
*/
protected function inlineImage($Excerpt)
{
$image = parent::inlineImage($Excerpt);
$path = new \Enrise\Uri($image['element']['attributes']['src']);
if ($path->isRelative()) {
$image['element']['attributes']['src'] = dol_buildpath('/mymodule/' . $path, 1);
}
return $image;
}
示例3: inlineImage
/**
* Overload the function to either return nothing (if image image rendering is disable) or return the
* rendered image by calling the Parsedown function
*
* @param string $Excerpt The excerpt of text to be processed as an image
*
* @return array|null|void
*/
protected function inlineImage($Excerpt)
{
if ($this->allowImages) {
$Image = parent::inlineImage($Excerpt);
if ($this->camo['enabled']) {
$parts = parse_url($Image['element']['attributes']['src']);
if (!isset($parts['host']) || strlen($parts['host']) === 0) {
return null;
}
if (!in_array($parts['host'], $this->camo['whitelisted_domains'])) {
$Image['element']['attributes']['src'] = $this->camo['base_url'] . hash_hmac('sha1', $Image['element']['attributes']['src'], $this->camo['key']) . '/' . bin2hex($Image['element']['attributes']['src']);
}
}
return $Image;
}
return null;
}