Revision #155 has been created by rackycz on Oct 13, 2019, 11:45:35 AM with the memo:
richtext
« previous (#154) next (#156) »
Changes
Title
unchanged
Yii v2 snippet guide
Category
unchanged
Tutorials
Yii version
unchanged
2.0
Tags
unchanged
tutorial,beginner,yii2
Content
changed
[...]
If you want to allow user to enter html-formatted text, you need to use some HTML wysiwyg editor, because ordinary TextArea can only work with plain text. It seems to me that [Summernote](https://summernote.org/getting-started/#simple-example) is the simplest addon available:
```javascript
// Add following code to file layouts/main.php ..
// But make sure jquery is already loaded !!
// - Read abo
veut this topic in chapter "Adding a google-like calendar"
<!-- include summernote css/js -->[...]
```
iOn this
tutorialpage I showed how to save Contacts inqueries into database. If you want to use th
ise richte
chxt editor in this section, open view conta
sct/\_form.php and just add this JS code:
```javascript[...]
'attributes' => [
// ...
'body:html', // html
],
])
```
... to discover all possible formatters, check all asXXX() functions on [this](https://www.yiiframework.com/doc/api/2.0/yii-i18n-formatter) page: