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


PHP Converter::__construct方法代码示例

本文整理汇总了PHP中Converter::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Converter::__construct方法的具体用法?PHP Converter::__construct怎么用?PHP Converter::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Converter的用法示例。


在下文中一共展示了Converter::__construct方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Create a new commonmark converter instance.
  *
  * @param array            $config
  * @param Environment|null $environment
  */
 public function __construct(array $config = [], Environment $environment = null)
 {
     if ($environment === null) {
         $environment = Environment::createCommonMarkEnvironment();
     }
     $environment->mergeConfig($config);
     parent::__construct(new DocParser($environment), new HtmlRenderer($environment));
 }
开发者ID:colinodell,项目名称:commonmark-php,代码行数:14,代码来源:CommonMarkConverter.php

示例2: __construct

 public function __construct($addr_id, $user_id)
 {
     parent::__construct($addr_id);
     $this->user = $user_id;
 }
开发者ID:Qeenslet,项目名称:elite-lara,代码行数:5,代码来源:ConverterForUser.php

示例3: __construct

 /**
  * constructor, see Markdownify::Markdownify() for more information
  */
 public function __construct($linksAfterEachParagraph = self::LINK_AFTER_CONTENT, $bodyWidth = MDFY_BODYWIDTH, $keepHTML = MDFY_KEEPHTML)
 {
     parent::__construct($linksAfterEachParagraph, $bodyWidth, $keepHTML);
     // new markdownable tags & attributes
     // header ids: # foo {bar}
     $this->isMarkdownable['h1']['id'] = 'optional';
     $this->isMarkdownable['h1']['class'] = 'optional';
     $this->isMarkdownable['h2']['id'] = 'optional';
     $this->isMarkdownable['h2']['class'] = 'optional';
     $this->isMarkdownable['h3']['id'] = 'optional';
     $this->isMarkdownable['h3']['class'] = 'optional';
     $this->isMarkdownable['h4']['id'] = 'optional';
     $this->isMarkdownable['h4']['class'] = 'optional';
     $this->isMarkdownable['h5']['id'] = 'optional';
     $this->isMarkdownable['h5']['class'] = 'optional';
     $this->isMarkdownable['h6']['id'] = 'optional';
     $this->isMarkdownable['h6']['class'] = 'optional';
     // tables
     $this->isMarkdownable['table'] = array();
     $this->isMarkdownable['th'] = array('align' => 'optional');
     $this->isMarkdownable['td'] = array('align' => 'optional');
     $this->isMarkdownable['tr'] = array();
     array_push($this->ignore, 'thead');
     array_push($this->ignore, 'tbody');
     array_push($this->ignore, 'tfoot');
     // definition lists
     $this->isMarkdownable['dl'] = array();
     $this->isMarkdownable['dd'] = array();
     $this->isMarkdownable['dt'] = array();
     // link class
     $this->isMarkdownable['a']['id'] = 'optional';
     $this->isMarkdownable['a']['class'] = 'optional';
     // footnotes
     $this->isMarkdownable['fnref'] = array('target' => 'required');
     $this->isMarkdownable['footnotes'] = array();
     $this->isMarkdownable['fn'] = array('name' => 'required');
     $this->parser->blockElements['fnref'] = false;
     $this->parser->blockElements['fn'] = true;
     $this->parser->blockElements['footnotes'] = true;
     // abbr
     $this->isMarkdownable['abbr'] = array('title' => 'required');
     // build RegEx lookahead to decide wether table can pe parsed or not
     $inlineTags = array_keys($this->parser->blockElements, false);
     $colContents = '(?:[^<]|<(?:' . implode('|', $inlineTags) . '|[^a-z]))*';
     $this->tableLookaheadHeader = '{
 ^\\s*(?:<thead\\s*>)?\\s*                                  # open optional thead
   <tr\\s*>\\s*(?:                                         # start required row with headers
     <th(?:\\s+align=("|\')(?:left|center|right)\\1)?\\s*>  # header with optional align
     \\s*' . $colContents . '\\s*                              # contents
     </th>\\s*                                            # close header
   )+</tr>                                               # close row with headers
 \\s*(?:</thead>)?                                        # close optional thead
 }sxi';
     $this->tdSubstitute = '\\s*' . $colContents . '\\s*           # contents
       </td>\\s*';
     $this->tableLookaheadBody = '{
   \\s*(?:<tbody\\s*>)?\\s*                                 # open optional tbody
     (?:<tr\\s*>\\s*                                       # start row
       %s                                                # cols to be substituted
     </tr>)+                                             # close row
   \\s*(?:</tbody>)?                                      # close optional tbody
 \\s*</table>                                             # close table
 }sxi';
 }
开发者ID:pixel418,项目名称:markdownify,代码行数:67,代码来源:ConverterExtra.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     $this->setRowConverter(new ObjectArraySerializer());
 }
开发者ID:perryflynn,项目名称:PerrysLambda,代码行数:5,代码来源:ObjectArrayConverter.php

示例5: __construct

 public function __construct(array $input, $baseEncodings = array('UTF-8', 'ISO-8859-1'))
 {
     parent::__construct($input, $baseEncodings);
 }
开发者ID:openworkers,项目名称:components,代码行数:4,代码来源:ArrayConverter.php

示例6: __construct

 public function __construct()
 {
     parent::__construct('addons', 'en', self::HOMEPAGE);
 }
开发者ID:newPOPE,项目名称:web-addons.nette.org,代码行数:4,代码来源:AddonsConverter.php


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