1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-08 14:16:46 +02:00

Content: new methods added: initShortcodes() initMarkdown() markdown()

Events: new events added: onMarkdownInitialized and onShortcodesInitialized
This commit is contained in:
Awilum
2018-05-21 16:05:08 +03:00
parent d250997953
commit d13b6d9f53

View File

@@ -73,14 +73,11 @@ class Content
// Event: The page is not processed and not sent to the display.
Event::dispatch('onPageBeforeRender');
// Create Markdown Parser object
Content::$markdown = new Markdown();
// Init Markdown
Content::initMarkdown();
// Create Shortcode Parser object
Content::$shortcode = new ShortcodeFacade();
// Register default shortcodes
Content::registerDefaultShortcodes();
// Init Shortcodes
Content::initShortcodes();
// Set current requested page data to $page array
Content::$page = Content::getPage(Http::getUriString());
@@ -323,6 +320,17 @@ class Content
}
}
/**
* Returns $markdown object
*
* @access public
* @return object
*/
public static function markdown() : Markdown
{
return Content::$markdown;
}
/**
* Returns $shortcode object
*
@@ -461,6 +469,39 @@ class Content
});
}
/**
* Init Markdown
*
* @access protected
* @return void
*/
protected static function initMarkdown() : void
{
// Create Markdown Parser object
Content::$markdown = new Markdown();
// Event: Markdown initialized
Event::dispatch('onMarkdownInitialized');
}
/**
* Init Shortcodes
*
* @access protected
* @return void
*/
protected static function initShortcodes() : void
{
// Create Shortcode Parser object
Content::$shortcode = new ShortcodeFacade();
// Register default shortcodes
Content::registerDefaultShortcodes();
// Event: Shortcodes initialized and now we can add our custom shortcodes
Event::dispatch('onShortcodesInitialized');
}
/**
* Display current page
*