本文整理汇总了PHP中Michelf\MarkdownExtra::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP MarkdownExtra::__construct方法的具体用法?PHP MarkdownExtra::__construct怎么用?PHP MarkdownExtra::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Michelf\MarkdownExtra
的用法示例。
在下文中一共展示了MarkdownExtra::__construct方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(Application $app)
{
$this->app = $app;
$this->app['publishing.active_item.toc'] = array();
$this->admonitionTypes = array('A' => 'aside', 'N' => 'note', 'W' => 'warning', 'T' => 'tip', 'E' => 'error', 'I' => 'information', 'Q' => 'question', 'D' => 'discussion');
$this->span_gamut += array('doPageBreaks' => 20);
$this->block_gamut += array('doAdmonitions' => 55);
parent::__construct();
}
示例2: __construct
public function __construct()
{
$this->running = false;
$this->empty_element_suffix = '>';
$this->hardWrap = false;
$this->document_gamut = array_merge($this->document_gamut, array('doConvertPlugins' => 27));
$this->block_gamut = array_merge($this->block_gamut, array('doConvertPlugins' => 10));
$this->span_gamut = array_merge($this->span_gamut, array('doInlinePlugins' => 2));
parent::__construct();
}
示例3: __construct
/**
* Create a new instance and enable or disable features.
* @param array $features enabled or disabled features
*
* You can pass an array of features to disable some of them for performance improvement.
* E.g.
* $features = array(
* 'table' => false,
* 'definition_list' => false
* )
*/
public function __construct(array $features = array())
{
parent::__construct();
$this->features = array_merge($this->features, $features);
if (!$this->features['header']) {
unset($this->block_gamut['doHeaders']);
}
if (!$this->features['list']) {
unset($this->block_gamut['doLists']);
}
if (!$this->features['horizontal_rule']) {
unset($this->block_gamut['doHorizontalRules']);
}
if (!$this->features['table']) {
unset($this->block_gamut['doTables']);
}
if (!$this->features['foot_note']) {
unset($this->document_gamut['stripFootnotes']);
unset($this->document_gamut['appendFootnotes']);
unset($this->span_gamut['doFootnotes']);
}
if (!$this->features['fenced_code_block']) {
unset($this->document_gamut['doFencedCodeBlocks']);
unset($this->block_gamut['doFencedCodeBlocks']);
}
if (!$this->features['abbreviation']) {
unset($this->document_gamut['stripAbbreviations']);
unset($this->span_gamut['doAbbreviations']);
}
if (!$this->features['definition_list']) {
unset($this->block_gamut['doDefLists']);
}
if (!$this->features['reference_link']) {
unset($this->document_gamut['stripLinkDefinitions']);
}
if (!$this->features['images']) {
unset($this->span_gamut['doImages']);
}
if (!$this->features['block_quote']) {
unset($this->block_gamut['doBlockQuotes']);
}
if (!$this->features['code_block']) {
unset($this->block_gamut['doCodeBlocks']);
}
if (!$this->features['auto_link']) {
unset($this->span_gamut['doAutoLinks']);
}
if (false === $this->features['entities']) {
$this->no_entities = true;
}
if (true === $this->features['no_html']) {
$this->no_markup = true;
}
}
示例4: __construct
/**
* Insert function calls inbetween the standard markdown calls
*
* @return void
*/
public function __construct()
{
// doImage is 10, add image url just before
$this->span_gamut['doImageURL'] = 9;
// doLink is 20, add base url just before
$this->span_gamut['doBaseURL'] = 19;
// Add API links
$this->span_gamut['doAPI'] = 90;
// Add note spans last
$this->span_gamut['doNotes'] = 100;
// PHP4 makes me sad.
parent::__construct();
}
示例5: __construct
public function __construct($sInputGroupTemplate = '', $sCheckboxGroupTemplate = '', $sTextareaGroupTemplate = '')
{
#
# Constructor function. Initialize the parser object.
#
# Insert extra document, block, and span transformations.
# Parent constructor will do the sorting.
$this->span_gamut += array("doInputs" => 70);
# Set form to span element to prevent extra <p> tags
$this->contain_span_tags_re .= '|form';
if (!empty($sInputGroupTemplate)) {
$this->sInputGroupTemplate = $sInputGroupTemplate;
}
if (!empty($sCheckboxGroupTemplate)) {
$this->sCheckboxGroupTemplate = $sCheckboxGroupTemplate;
}
if (!empty($sTextareaGroupTemplate)) {
$this->sTextareaGroupTemplate = $sTextareaGroupTemplate;
}
parent::__construct();
}
示例6: __construct
public function __construct(array $options = null)
{
#
# Constructor function. Initialize the parser object.
#
$this->escape_chars .= '';
$this->document_gamut += array();
$this->block_gamut += array("doBlockTitles" => 11, "doDocBreaks" => 20);
$this->span_gamut += array("doPageNums" => 9, "doRubies" => 50, "doTcys" => 50);
parent::__construct();
// Harusame options
if (false === is_null($options)) {
if (array_key_exists("autoTcy", $options)) {
if (is_bool($options["autoTcy"])) {
$this->autoTcy = $options["autoTcy"];
} else {
trigger_error("autoTcy should be boolean.");
}
}
if (array_key_exists("tcyDigit", $options)) {
if (is_int($options["tcyDigit"])) {
if ($options["tcyDigit"] < 2) {
trigger_error("tcyDigit should be 2 or greater.", E_USER_ERROR);
} else {
$this->tcyDigit = $options["tcyDigit"];
}
} else {
trigger_error("tcyDigit should be int.");
}
}
if (array_key_exists("autoTextOrientation", $options)) {
if (is_bool($options["autoTextOrientation"])) {
$this->autoTextOrientation = $options["autoTextOrientation"];
} else {
trigger_error("autoTextOrientation should be boolean.");
}
}
}
}
示例7: __construct
public function __construct()
{
parent::__construct();
$this->span_gamut['doParseIncidentVariables'] = 7;
$this->mappingIncidentVariables = ['{{IP}}' => '{{incident.hostAddress}}', '{{hostAddress}}' => '{{incident.hostAddress}}', '{{reporter}}' => '{{incident.reporter}}', '{{type}}' => '{{incident.type}}', '{{network}}' => '{{incident.network}}', '{{networkAdmin}}' => '{{incident.network.networkAdmin}}'];
}
示例8: __construct
public function __construct(){
// Add a few features to the default Markdown formatter.
// This will use Core to generate a unique ID for header fields.
$this->header_id_func = [$this, 'generateHeaderID'];
// This will add the [TOC] tag to MD.
$this->document_gamut += ['doTOC' => 55];
// Process all metadata on this document
$this->document_gamut += ['doMeta' => 1];
$this->document_gamut += ['doMetaPost' => 99];
$this->url_filter_func = [$this, 'doLink'];
parent::__construct();
}