本文整理匯總了PHP中text::auto_link_urls方法的典型用法代碼示例。如果您正苦於以下問題:PHP text::auto_link_urls方法的具體用法?PHP text::auto_link_urls怎麽用?PHP text::auto_link_urls使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類text
的用法示例。
在下文中一共展示了text::auto_link_urls方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: auto_link_urls
/**
* Tests the text::auto_link_urls() function.
* @dataProvider auto_link_urls_provider
* @group core.helpers.text.auto_link_urls
* @test
*/
public function auto_link_urls($text, $expected_result)
{
$result = text::auto_link_urls($text);
$this->assertEquals($expected_result, $result);
}
示例2: foreach
if ($option->tags) {
?>
<div class="tags">
<?php
foreach ($option->tags as $name => $set) {
?>
<h5><?php
echo ucfirst($name);
?>
</h5>
<ul>
<?php
foreach ($set as $tag) {
?>
<li><?php
echo text::auto_link_urls($tag);
?>
</li>
<?php
}
?>
</ul>
<?php
}
?>
</div>
<?php
}
?>
<a class="top" href="#top">(top)</a>
</div>
示例3: auto_link
/**
* Converts text email addresses and anchors into links.
*
* @param string text to auto link
* @return string
*/
public static function auto_link($text)
{
// Auto link emails first to prevent problems with "www.domain.com@example.com"
return text::auto_link_urls(text::auto_link_emails($text));
}
示例4: __
<?php
echo html::nick($comment->author_id, $comment->author->username);
?>
,
<?php
echo __(':ago ago', array(':ago' => html::time(date::timespan_short($comment->created), $comment->created)));
?>
</header>
<p>
<?php
echo $comment->private ? '<abbr title="' . __('Private comment') . '">' . __('Priv') . '</abbr>: ' : '';
?>
<?php
echo text::smileys(text::auto_link_urls(html::specialchars($comment->comment)));
?>
</p>
</article>
<?php
}
?>
<footer>
<?php
echo $pagination;
?>
</footer>