PHP code example of coderlex / yii2-markitup

1. Go to this page and download the library: Download coderlex/yii2-markitup library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

coderlex / yii2-markitup example snippets


$form = \yii\widgets\ActiveForm::begin();
print $form->field($model, 'content')->widget(\coderlex\markitup\MarkItUp::className(), [
	// Textarea options (default):
	'options' => ['class' => 'form-control', 'style' => 'overflow:auto;resize:none;'],
	// Skin (default):
	'skin' => 'simple',
	// JS widget initialization options:
	'clientOptions' => [
		'markupSet' => [ 	
			[
				'name' => 'Bold',
				'key' => 'B',
				'className' => 'markitup-bold',
				'openWith' => '[b]',
				'closeWith' => '[/b]'
			],
			// ...
			['separator' => '---------------'],
			[
				'name' => 'Numeric List',
				'className' => 'markitup-nlist',
				'openWith' => '[*]',
				'multiline' => true,
				'openBlockWith' => "[list=1]\n",
				'closeBlockWith' => "\n[/list]"
			],
			// ...
			['separator' => '---------------'],
			[
				'name' => 'Link',
				'key' => 'L',
				'className' => 'markitup-link',
				'replaceWith' => '[url=[![Link:!:http://]!]](!( title="[![Title]!]")!)[/url]',
				'placeHolder' => 'Your text to link...'
			],
			// ...
		]
	],
]);
\yii\widgets\ActiveForm::end();
bash
php composer.phar global oderlex/yii2-markitup" "*"