1. Go to this page and download the library: Download opotemkin/yii2-markdown library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
'modules' = [
'markdown' => [
// the module class'class' => 'kartik\markdown\Module',
// the controller action route used for markdown editor preview'previewAction' => '/markdown/parse/preview',
// the list of custom conversion patterns for post processing'customConversion' => [
'<table>' => '<table class="table table-bordered table-striped">'
],
// whether to use PHP SmartyPantsTypographer to process Markdown output'smartyPants' => true
]
/* other modules */
];
// add this in your viewusekartik\markdown\MarkdownEditor;
// usage with modelecho MarkdownEditor::widget([
'model' => $model,
'attribute' => 'markdown',
]);
// usage without modelecho MarkdownEditor::widget([
'name' => 'markdown',
'value' => $value,
]);
'modules' = [
'markdown' => [
'class' => 'kartik\markdown\Module',
'smarty' => true,
// Smarty class configuration'smartyParams' => [],
// provide Yii::$app to the Smarty template as variable'smartyYiiApp' => true,
// provide Yii::$app->params to the Smarty template as config variables'smartyYiiParams' => true,
],
/* other modules */
];