Last active
July 28, 2022 15:49
-
-
Save vojtasvoboda/833d67afebfcdbf204ce to your computer and use it in GitHub Desktop.
Extend backend form in OctoberCMS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function boot() | |
{ | |
// Extend all backend form usage | |
Event::listen('backend.form.extendFields', function($widget) { | |
// Only for the Posts controller | |
if (!$widget->getController() instanceof \RainLab\Blog\Controllers\Posts) | |
return; | |
// Only for the Post model | |
if (!$widget->model instanceof \RainLab\Blog\Models\Post) | |
return; | |
// Update content field | |
$widget->addSecondaryTabFields([ | |
'content' => [ | |
'tab' => 'rainlab.blog::lang.post.tab_edit', | |
'type' => 'richeditor', | |
'size' => 'huge', | |
] | |
]); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment