Homepage
Main navigation
Main content
Additional information
Login / Sign up
Quality Guidelines
About
GitHub
Propose new content
Winter CMS resources and help articles
Simple and to the point. Optimized by the community.
×
Login / Sign up
Quality Guidelines
About
GitHub
Propose new content
Edit trick
Changes will be published after manual review
Title
Give your trick a describing title. Do
not
start with «How to...».
Your trick
Keep it short and concise! Markdown is supported.
```php <?php namespace StudioAzura\Foundation\FormWidgets; use Backend\FormWidgets\RichEditor; class RichEditorPlus extends RichEditor { protected $defaultAlias = 'rich-editor-plus'; public function init() { // set the parent's viewPath so that its partials can be found. $this->addViewPath('~/modules/backend/formwidgets/richeditor/partials'); parent::init(); } protected function loadAssets() { $savedAssetPath = $this->assetPath; // set the parent's assetPath so that its assets can be found. $this->assetPath = '/modules/backend/formwidgets/richeditor/assets'; parent::loadAssets(); // reset our own assetPath $this->assetPath = $savedAssetPath; $this->addJs('js/richeditorplus.js'); } } ``` And you need to register the new formwidget: ```php public function registerFormWidgets() { return [ FormWidgets\RichEditorPlus::class => 'richeditorplus', ]; } ```
References
Add additional online resources to your trick
+ Add reference
Topics
If your trick fits more than one topic select multiple. Select at least one.
Backend
Plugin Development
CMS
Twig
Themes
Deployment
Tags
You can use existing tags or create new ones. Add at least one.
Submit for review
Cancel
We use cookies to measure the performance of this website. Do you want to accept these cookies?
Accept
Decline