Revision #154 was created by rackycz on Oct 13, 2019, 11:40:26 AM.
richtext
Content
[...]
```php
$model->scenario = "abc";
```
... but had no **rule** defined yet. I wanted to implement the rule later, but I didnt know that when you set a scenario to your model it **must** be used in method rules() or defined in method scenarios(). So take this into consideration. I expected that when the scenario has no rules it will just be skipped or deleted.
**Richtext / wysiwyg HTML editor - Summernote**
---
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 above in chapter "Adding a google-like calendar"
in this tutorial I showed how to save Contacts inqueries into database. If you want to use this richtech editor in this section, open view contast/\_form.php and just add this JS code:
```javascript
<script>
$(document).ready(function() {
$('#contact-body').summernote();
});
</script>
```
It will be saved to DB as HTML code. But this might be also a source of problems, because user can inject some dangerous HTML code. So keep this in mind.
Now you will also have to modify view contact/view.php like this in order to see nice formatted text: