当前位置: 首页>>代码示例>>PHP>>正文


PHP BBCode::BBCode方法代码示例

本文整理汇总了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('')));
 }
开发者ID:anqh,项目名称:anqh,代码行数:32,代码来源:bb.php

示例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));
 }
开发者ID:anqqa,项目名称:Anqh,代码行数:28,代码来源:BB.php


注:本文中的BBCode::BBCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。