Markdown
extends Base
in package
implements
IView
uses
CacheableView
Generate html output by combining a layout with a view and data.
Table of Contents
Interfaces
- IView
- View interface for the Neuron MVC framework's rendering system.
Properties
- $fs : IFileSystem
- $_cache : ViewCache|null
- $_cacheEnabled : bool|null
- $_controller : string
- $_layout : string
- $_page : string
Methods
- __construct() : mixed
- getCacheEnabled() : bool|null
- Get cache enabled setting for this view instance
- getController() : string
- getLayout() : string
- getPage() : string
- render() : string
- Render data array into formatted output string.
- setCacheEnabled() : Base
- Set cache enabled setting for this view instance
- setController() : Html
- setLayout() : Html
- setPage() : Html
- findMarkdownFile() : string|null
- Find markdown file using directory path
- getCachedContent() : string|null
- Get cached content
- getCacheKey() : string
- Get cache key for current view
- getCommonmarkConverter() : MarkdownConverter
- isCacheEnabled() : bool
- Check if cache is enabled
- setCachedContent() : void
- Set cached content
- getCache() : ViewCache|null
- Get cache instance
- initializeCache() : ViewCache|null
- Initialize cache from registry
Properties
$fs
protected
IFileSystem
$fs
$_cache
private
ViewCache|null
$_cache
= null
$_cacheEnabled
private
bool|null
$_cacheEnabled
= null
$_controller
private
string
$_controller
$_layout
private
string
$_layout
$_page
private
string
$_page
Methods
__construct()
public
__construct([IFileSystem|null $fs = null ]) : mixed
Parameters
- $fs : IFileSystem|null = null
getCacheEnabled()
Get cache enabled setting for this view instance
public
getCacheEnabled() : bool|null
Return values
bool|null —null means use global config, true/false overrides global
getController()
public
getController() : string
Return values
stringgetLayout()
public
getLayout() : string
Return values
stringgetPage()
public
getPage() : string
Return values
stringrender()
Render data array into formatted output string.
public
render(array<string|int, mixed> $data) : string
Parameters
- $data : array<string|int, mixed>
Tags
Return values
string —markdown output
setCacheEnabled()
Set cache enabled setting for this view instance
public
setCacheEnabled(bool|null $cacheEnabled) : Base
Parameters
- $cacheEnabled : bool|null
-
null uses global config, true/false overrides
Return values
BasesetController()
public
setController(string $controller) : Html
Parameters
- $controller : string
Return values
HtmlsetLayout()
public
setLayout(string $layout) : Html
Parameters
- $layout : string
Return values
HtmlsetPage()
public
setPage(string $page) : Html
Parameters
- $page : string
Return values
HtmlfindMarkdownFile()
Find markdown file using directory path
protected
findMarkdownFile(string $basePath, string $pageName) : string|null
Parameters
- $basePath : string
-
Base directory for controller views
- $pageName : string
-
Relative path to markdown file (e.g., "cms/guides/authentication")
Return values
string|null —Full path to markdown file or null if not found
getCachedContent()
Get cached content
protected
getCachedContent(string $key) : string|null
Parameters
- $key : string
Return values
string|nullgetCacheKey()
Get cache key for current view
protected
getCacheKey(array<string|int, mixed> $data) : string
Parameters
- $data : array<string|int, mixed>
Return values
stringgetCommonmarkConverter()
protected
getCommonmarkConverter() : MarkdownConverter
Return values
MarkdownConverterisCacheEnabled()
Check if cache is enabled
protected
isCacheEnabled() : bool
Return values
boolsetCachedContent()
Set cached content
protected
setCachedContent(string $key, string $content) : void
Parameters
- $key : string
- $content : string
getCache()
Get cache instance
private
getCache() : ViewCache|null
Return values
ViewCache|nullinitializeCache()
Initialize cache from registry
private
initializeCache() : ViewCache|null