本文整理汇总了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));
}
示例2: __construct
public function __construct($addr_id, $user_id)
{
parent::__construct($addr_id);
$this->user = $user_id;
}
示例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';
}
示例4: __construct
public function __construct()
{
parent::__construct();
$this->setRowConverter(new ObjectArraySerializer());
}
示例5: __construct
public function __construct(array $input, $baseEncodings = array('UTF-8', 'ISO-8859-1'))
{
parent::__construct($input, $baseEncodings);
}
示例6: __construct
public function __construct()
{
parent::__construct('addons', 'en', self::HOMEPAGE);
}