Product support

Get help in the plugin support forum.


This plugin includes Form Widgets and Behaviors.

Form Widgets

  • Button
  • MapPicker


  • AutosizeModel
  • ModalController
  • TrashController

Twig Extensions

  • numberToWord filter


  • array_map_recursive() function

See the Documentation tab for details.

This plugin includes Form Widgets and Behaviors

Form Widgets


Twig Extensions



Button FormWidget

In your fields.yaml of your plugin, define the field type button.
For official documentation go to OctoberCMS Docs page.

button - renders an html anchor element with .btn class.

        type: button
        text: Reload Items
        css: btn-default oc-icon-refresh
        loadingIndicator: true
            model-request: onReloadItems
Option Description
text Button Label
css Css class name (.btn is allways added). See OC Button Docs
loadingIndicator Render loading indicator when button is clicked
dataAttr Array with format key: value. Each item will be rendered as data-{KEY}='{VALUE}'

If the form widget is used to request ajax call, use the documented data attributes, without the first data-.

        type: button
        text: Calculate
        css: btn-primary oc-icon-calculator
            request: onCalculate
            request-update: "calcresult: '#result'"

If the form widget is used in Settings page, without a controller, the ajax request method must be in the model. In this case, use model-request instead of request.

Map Picker FormWidget

MapPicker Screen

    type: mappicker
        location: address
        latitude: lat
        longitude: lng
        city: city
        state: state
        country: country
        country-long: country_long

fieldMap options must be in format key: value, where key is the map data element, and value is the form field name, where set value on change address.
The list of options:

  • location
  • latitude
  • longitude
  • city
  • zip
  • state
  • country (can be a text field or options select)
  • country-long

Autosize Model Behavior

Automatic resize uploaded images to pre configured max width/height.
The use is very simple, just add this line to your model.

  public $implement = [ 'PlanetaDelEste.Widgets.Behaviors.AutosizeModel' ];     
  public $autosizeRelation = 'relation_name';  

In this example, extend the model RainLab\User\Models\User and add this behavior dynamically.
In your Plugin.php write this:

use RainLab\User\Models\User;     
class Plugin extends PluginBase  
    public function boot() { 
      // Extend RainLab User model 
      User::extend( function (User $model) { 
          $model->addDynamicProperty('autosizeRelation', 'avatar'); 
          $model->implement[] = '@PlanetaDelEste.Widgets.Behaviors.AutosizeModel'; 
      } ); 

And after model is saved, all images will be resized.

This plugin require intervention/image library.

Modal Controller Behavior

This behavior is used to load create/update forms in modal window, from the lists view


1) - In controller add PlanetaDelEste.Widgets.Behaviors.ModalController to the $implementvar.

    public $implement = [  
        'Backend.Behaviors.FormController', 'Backend.Behaviors.ListController',

2) - In _list_toolbar.htm add the attribute onclick="return $.manageModal.createRecord()" to the create new button

        href="<?= Backend::url('acme/foo/categories/create') ?>"  
        onclick="return $.manageModal.createRecord()"  
        class="btn btn-primary oc-icon-plus">  
        <?= e(trans('acme.foo::lang.category.new')) ?>  

3) - From config_list.yaml comment the line recordUrl: ... and add recordOnClick: $.manageModal.clickRecord(:id)

 # =================================== 
 #  List Behavior Config 
 # ===================================     
 # Link URL for each record  

 recordOnClick: $.manageModal.clickRecord(:id)

Modal Controller

Trash Controller

Add a controller to manage trashed records (Model with SoftDelete trait).


See the official documentation In your Controller add this line to $implement:

     * Implement the TrashController behavior
    public $implement = [

Or if you want to extend a controller from your plugin, add this lines to boot method

FooController::extend(function($controller) {

    // Implement behavior if not already implemented
    if (!$controller->isClassExtendedWith('PlanetaDelEste.Widgets.Behaviors.TrashController'))       
        $controller->implement[] = 'PlanetaDelEste.Widgets.Behaviors.TrashController';

    if(request()->segment(5) == 'trashed') {  

Number to Word

Twig filter to convert any number into world

{{ 8|numberToWord }}  

The example would output &quot;eight&quot;



array_map_recursive Applies the callback to the elements of the given arrays recursively

$array = [
    'users' => [
        ' Brian',
        'Shannon ',
        'Alec ',
    'features' => [
        'PHP ',
        'Ruby   ',
        'JavaScript ',
$array = array_map_recursive('trim', $array);
    'users' => [
    'features' => [

Add TrashController behavior

May 30, 2018


Add Google api key setting

Nov 12, 2017


Fix Riskihajar\Terbilang provider nameclass

Feb 23, 2017


Use \System\Models\File::getLocalPath instead of \System\Models\File::getPath

Feb 21, 2017


New auto apply of AutosizeBehavior for some known models

Dec 08, 2016


Fix Unknown column 'autosizeRelation' error

Oct 10, 2016


!!! This is an important update that contains breaking changes. AutoziseModel behavior require the property autosizeRelation.

Oct 06, 2016


Add numberToWord twig filter

Mar 08, 2016


Add AutoziseModel behavior

Mar 08, 2016


Add Button form widget

Mar 08, 2016


First version of Widgets

Mar 08, 2016