本文整理汇总了PHP中BBCode::BBCode方法的典型用法代码示例。如果您正苦于以下问题:PHP BBCode::BBCode方法的具体用法?PHP BBCode::BBCode怎么用?PHP BBCode::BBCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BBCode
的用法示例。
在下文中一共展示了BBCode::BBCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Create new BBCode object and initialize our own settings
*
* @param string $text
*/
public function __construct($text = null)
{
parent::BBCode();
$this->text = $text;
// Automagically print hrefs
$this->SetDetectURLs(true);
// We have our own smileys
$config = Kohana::$config->load('site.smiley');
if (!empty($config)) {
$this->ClearSmileys();
$this->SetSmileyURL(URL::base() . $config['dir']);
foreach ($config['smileys'] as $name => $smiley) {
$this->AddSmiley($name, $smiley['src']);
}
} else {
$this->SetEnableSmileys(false);
}
// We handle newlines with Kohana
//$this->SetIgnoreNewlines(true);
$this->SetPreTrim('a');
$this->SetPostTrim('a');
// User our own quote
$this->AddRule('quote', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array($this, 'bbcode_quote'), 'class' => 'block', 'allow_in' => array('listitem', 'block', 'columns'), 'content' => BBCODE_REQUIRED));
// Media tags
$this->AddRule('audio', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array($this, 'bbcode_media'), 'class' => 'block', 'allow_in' => array('listitem', 'block', 'columns', 'inline'), 'allow' => array('align' => '/^left|center|right$/'), 'default' => array('align' => 'left'), 'content' => BBCODE_REQUIRED, 'plain_content' => array('')));
$this->AddRule('video', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array($this, 'bbcode_media'), 'class' => 'block', 'allow_in' => array('listitem', 'block', 'columns', 'inline'), 'allow' => array('align' => '/^left|center|right$/'), 'default' => array('align' => 'left'), 'content' => BBCODE_REQUIRED, 'plain_content' => array('')));
}
示例2: __construct
/**
* Create new BBCode object and initialize our own settings
*
*/
public function __construct($text = null)
{
parent::BBCode();
$this->text = $text;
// Automagically print hrefs
$this->SetDetectURLs(true);
// We have our own smileys
$config = Kohana::config('site.smiley');
if (!empty($config)) {
$this->ClearSmileys();
$this->SetSmileyURL(url::base() . $config['dir']);
foreach ($config['smileys'] as $name => $smiley) {
$this->AddSmiley($name, $smiley['src']);
}
} else {
$this->SetEnableSmileys(false);
}
// We handle newlines with Kohana
$this->SetIgnoreNewlines(true);
$this->SetPreTrim('a');
$this->SetPostTrim('a');
// User our own quote
$this->AddRule('quote', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array($this, 'bbcode_quote'), 'class' => 'block', 'allow_in' => array('listitem', 'block', 'columns'), 'content' => BBCODE_REQUIRED));
}